Author Topic: Detect changes  (Read 2251 times)

mikep

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 165
    • View Profile
Detect changes
« 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' });

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6313
    • View Profile
Re: Detect changes
« Reply #1 on: March 06, 2020, 10:38:40 am »
Please use dataModel.recIndx ( primary key ) and use updateRow() method for grid to detect changes.

mikep

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 165
    • View Profile
Re: Detect changes
« Reply #2 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 });
}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6313
    • View Profile
Re: Detect changes
« Reply #3 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.