I'm unable to delete rows client-side using 2013.2. Among other things, I've tried the
grid.get_rows().remove(row) and it leaves the row as it is and visible. This is despite have editing core behavior added, and I even tried adding the delete behavior. I have batching turned on since I don't want postbacks/rebinding on every action. I had to fall back to how some posts in the forums suggested, by hiding the row with
$(row.get_element()).css('display', 'none')
This hides the row, but the alternating grid row colors now don't alternate since the grid counts that invisible row.
Aside from not being very intuitive if it did work, undoBatchUpdate() doesn't seem to do anything in this case. I would assume based on the name that it cancels the last batch update action. Should it work in this situation?
I bind the grid server-side. The user sees the grid with the results in it. They need to be able to delete rows from the grid on the client without a postback (UltraWebGrid could do this easily). They also need to be able to add rows without a postback.
When I call grid.get_behaviors().get_editingCore().undoBatchUpdate(row) as you recommended, nothing happens. No errors, and the row remains there. I've seen in other places grid.get_rows().remove(row) which seems much more intuitive, but still doesn't actually work.
On a side note... if there was appropriate/sufficient documentation for the CSOM rather than the auto-generated stuff that's there now, we might be able to figure this out without having to submit it to the forums and wait several days.
Hi revbones,
So the reason for this is that while you are hiding the row (a suggestion to account for handling client-side row deleting when Batch-Update is being used: http://es.infragistics.com/community/forums/t/73137.aspx) the grid row is not yet really deleted and still exists in html. And, for this reason, even though the row is not displayed, the css for the alt-row style accounts for its existence when setting the styles.
To deal with this you need to get that row removed completely so that the alt-row styles behaves as you'd expect. To do this you can undo the batch add operation: grid.get_behaviors().get_editingCore().undoBatchUpdate(row);
Please let me know if you need additional assistance.