Hi guys
Is there a way to check for rows that are not yet written to database?
What we want to do is use onBeforeUnload(), but not fire it unless there are rows marked with bold (marked as updated but unwritten).
Befor sending data to the server array dp.updatedRows contain ID of a rows which should be updated.
If you need not exact number, but just need to check is all data sent to server , it can be done as
dp.getSyncState();
returns true if all data saved, false otherwise
When using updatedRows, I found that when deleting a row that is not updated/written yet, it doesn’t seem to remove the row’s id from the updatedRows array. Is this true?
If row was added and deleted before saving data to server side - row will be removed from updatedRows collection, because there is no need for any DB sync. operation.
If existing row was updated and deleted, id will stay in updatedRows collection while response from server not received.
updatedRows collection stores IDs or all elements which need to be synced with server, it doesn’t matter was they really updated or deleted.