Author Topic: getRowData Method - Need clean data, but get a pq_cellselect object in data.  (Read 3609 times)

sudo

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 12
    • View Profile
I'm try to retrieve the row data to update the record on server.  When executing this:  var rowData = studyGrid.pqGrid("getRowData", {rowIndx: currentRow});  The rowData has an pq_cellselect object in it...  which I have to remove before sending to server.  Why is pq_cellselect part of the data returned for a Row?  You can see in the image of a screen shot of the debugger screen what I'm talking about.  Thanks for your help.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
pq_cellselect stores the state of cell selections.

If you don't want it on server side and dataModel.location is "remote", you could remove it in dataModel.beforeSend callback.

or

remove the selections selectionModel.type = null

sudo

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 12
    • View Profile
So is there any method that returns JUST the DATA and not the state or other "pq_" object?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
1) getRowData returns the row data by reference, so all pq_ variables are part of rowData.

2) getChanges({ format: "byVal" }) returns the changes by value after removing pq_* variables.
Code: [Select]
var changes = grid.getChanges({ format: "byVal" });

Example:

http://paramquery.com/pro/demos/editing_batch line number: 25

Please let me know whether it helps your case.
« Last Edit: March 17, 2015, 06:50:19 pm by paramquery »