ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: mikep on March 05, 2020, 09:21:36 pm

Title: Detect changes
Post by: mikep on March 05, 2020, 09:21:36 pm
1. in my drop function, I'm setting a text value in the drop row's column, but when I call getChanges, the grid doesn't detect the change. If I manually change the text value, getChanges detects the change. How can I register the change in code? The below code doesn't detect the change.

drop: function (evt, uiDrop) {
   uiDrop.rowData.id = "my new value that isnt detected"
   uiDrop.rowData.id1 = "mote new text"
}

var gridChanges = $gridMain.pqGrid("getChanges", { format: 'byVal' });
Title: Re: Detect changes
Post by: paramvir on March 06, 2020, 10:38:40 am
Please use dataModel.recIndx ( primary key ) and use updateRow() method for grid to detect changes.
Title: Re: Detect changes
Post by: mikep on March 06, 2020, 08:34:19 pm
Thank you. I am using .recIndx in my datamodel. I added updateRow() but still nothing is returned in getChanges.

drop: function (evt, uiDrop) {
   uiDrop.rowData.id = "my new value that isnt detected"
   uiDrop.rowData.id1 = "more new text"

 $gridMain.pqGrid('updateRow',{ rowIndx: uiDrop.rowIndx });
}
Title: Re: Detect changes
Post by: paramvir on March 06, 2020, 08:50:55 pm
Any changes made directly to rowData won't be detected. Please pass all the changes to updateRow method.