Please help with following problem:
On the client I add new row, after that I want to remove this row.
Scenario is following:
1. User clicks some button, new row is added.
2. Later user clicks Cancel button, I want to remove previosly added row.
I don't need any postbacks or other actions.
I do following:
myAddedRow.get_grid().get_rows().remove(myAddedRow);
But this doesn't remove row, just marks it as deleted, the button "Undo" is shown in the grid.
How can I completely remove this row?
Please help, using UltraWebGrid it was a default behavior.
Alexander
Hi Alexander,
You are correct in that it is a problem related only to the WebHierarchicalDataGrid. I have submitted bug 101538 regarding this. It is a simple fix and you can actually work around it with the following code after you call editCore.undoBatchUpdate grid._rows = new $IG.ContainerGridRowCollection(grid._elements["rows"], [grid._get_value($IG.WebDataGridProps.RowCount)], grid);
Jason, could you mark the bug as public and attach this case to it?
regards,David Young
Hi, Jason!
Thank you for help.
I've attached the sample. In your sample you use simple WebDataGrid, I've tried with it, but wasn't able to reproduce the problem. Probably the problem is WebHierarchicalDataGrid related only.
Steps to reproduce the problem:
1. Open page
2. Add new row (using either inline editing or using the button "Add row" (I've added it ))
3. Click Undo button after the new row has appeared
4. The row disappears
5. Try to select the last row - you cannot , the previous one is selected
6. Try to add one row again and click "Undo", - the row doesn't disappear
Hello Alexander,
I took the information you have provided and put together a small sample to test this. When I call the undoBatchUpdate operation and then start selecting other rows I have no issue.
I tested this with the latest service release, build 11.2.20112.2055. Are you able to reproduce the behavior in the sample I provided with that build? Is this the same build that you are using?
If this sample isn't an accurate representation of what you want to do please let me know.
Yes, I have the latest Service Release.
Hi,
When you call undoBatchUpdate, you should NOT call remove if you want the row gone. The remove marks it deleted and then the undo would just undo the deleted and put it back as added. The JS exceptions could be bugs. Do you have the latest Service Release?