Hello,
I have a ListGrid and for various reasons I am mocking out the server-side code for executeUpdate. The server-side code returns a response containing the data, which is sent back to the client, which then needs to set the edits into the records as regular attributes. This is mostly working fine, and the grid appears to be taking in the edits, but when I then go to edit another row, the seemingly-saved edits in the original row then reset back to the way before.
Basically in my client-side code I am doing this:
And in my server-side code (mocking out the update request to something custom)
I analyzed the DS responses and the data sent from the server to the client looks completely fine and there are no issues with that.
Any ideas why the grid behavior in the UI is not working 100%? As I mentioned the edits do appear to be saved (i.e. go from blue to gray), but if I afterwards edit any row, the "saved" edits then go back to the way before.
I did manage to create a workaround though by adding a callback to grid.saveAllEdits() and setting the attributes directly.
I have a ListGrid and for various reasons I am mocking out the server-side code for executeUpdate. The server-side code returns a response containing the data, which is sent back to the client, which then needs to set the edits into the records as regular attributes. This is mostly working fine, and the grid appears to be taking in the edits, but when I then go to edit another row, the seemingly-saved edits in the original row then reset back to the way before.
Basically in my client-side code I am doing this:
Code:
grid.setEditValue(rowNum, displayField, strBuilder.substring(0,strBuilder.length()-1)); grid.setEditValue(rowNum, colNum, valBuilder.substring(0,valBuilder.length()-1)); grid.refreshRow(rowNum); grid.invalidateCache(); if (saveChanges) { grid.saveAllEdits() }
Code:
public DSResponse updateChipSTAResponsibleEmails(DSRequest updateRequest) throws Exception { Map<String, String> dataItem = new HashMap(updateRequest.getValues()); retlist.add(dataItem); resp.setData(retlist); resp.setAffectedRows(1); return resp; }
Any ideas why the grid behavior in the UI is not working 100%? As I mentioned the edits do appear to be saved (i.e. go from blue to gray), but if I afterwards edit any row, the "saved" edits then go back to the way before.
I did manage to create a workaround though by adding a callback to grid.saveAllEdits() and setting the attributes directly.
Comment