I have a grid with a dataprocessor.
I have my dataprocessor configured like so:
This way all data is sent to server once I hit the “Save” button. My problem is that I also have a “Delete Rows” button which I use to delete all selected rows.
My dilemma is if a user makes an edit to one row…and then decides to highlight another row(s) to delete it. When the user hits “Delete Rows”, it will delete the selected row(s)…but will also send the updated/inserted data to the server, because I need to perform a oDP.sendData() action to finalize the delete.
This is all processed just fine in my save routine which handles all inserts, deletes or updates dependent on the _!nativeeditor_status value of the row, but my wish is to only send the selected rows to the server when the “Delete Rows” button is clicked and to only send updated/ inserted rows to the server when the “Save” button is clicked.
Is this possible? Suggestions?
I know that setting setUpdateMode = true would solve this problem, but my grid is a child grid within a parent form…So I don’t want part of the form to be saved with a save button and the other part of the form (the grid) to be saved automatically after each edit. This may confuse the users.
DataProcessor doesn’t separate different types of updates, but you can use
In such case, dataprocessor will send info only about one specified row.
If you need to send multiple rows , you can try to use the next approach
var up = dp.updatedRows;
for (var i=0; i<up.length; i++)
dp.updatedRows = up;
Above code will filter list of updated rows, so only deleted will be sent to server.
Could you clarify what you are doing with this line of code?
It does not seem to work. It looks like your reseting it to an empty array, but dp.updatedRows gives me a comma delimited string.
Sorry the line of code above seems to be fine as long as I remove the var and it is an array, but I have another problem with the .getState(). It says object does not support this property.
>>Could you clarify what you are doing with this line of code?
dp.updatedRows - array of IDs
>> I have another problem with the .getState()
Which version of dataprocessor you are using?
In case of old one, getState can be replaced with
Thanks that did it.