Author Topic: updateRow doesn't replace fields with empty values  (Read 186 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
updateRow doesn't replace fields with empty values
« on: October 07, 2024, 03:55:43 pm »
as it says in the title

Code: [Select]
rowData = {"field":1, "another":"something", "more":"hello"};

newData = {"field":0, "another":"0", "more":null};

Using

Code: [Select]
grid.updateRow( {
    rowIndx: 2,
    newRow: newData,
    checkEditable:false
});

does not update the "empty" fields
« Last Edit: October 07, 2024, 04:16:14 pm by jplevene »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: updateRow doesn't replace fields with empty values
« Reply #1 on: October 07, 2024, 04:12:25 pm »
Validation rules in those columns might be preventing the update.

Please share a jsfiddle if still facing issues.

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Re: updateRow doesn't replace fields with empty values
« Reply #2 on: October 07, 2024, 04:15:46 pm »
Will do if I get the time.

To fix it I just did:

Code: [Select]
$.extend(row["rowData"], new_rowData);
grid.refreshRow({rowIndx:row["rowIndx"]});

I the original example I didn't include checkEditable:false in the example, but even if I did (which I did do in my code) the bug remains