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,
It sounds like you have batch updating on. If you have added a row on the client and not yet had it commited and then want it completely removed, you should call editingCore.undoBatchUpdate(row); This will completely remove it. If the row was already there, it will just mark it for deletion. You could set the DeletedRow role to have display none or something. That may work.
regards,David Young
Hi, David!
Thank you for your answer.
Yes, batch updating is on. Yes, row has been added on client, and I want to remove it on the client side
I've tried following:
addedRow.get_grid().get_behaviors().get_editingCore().undoBatchUpdate(addedRow);
This method removes it from the list, but after that I cannot select the last row in the grid.
If I click on any rows, I get java script errors.
And If I try again to add row and call this method it doesn't remove it.
Should I call remove method for the added row before this method or after
addedRow.get_grid().get_rows().remove(addedRow);
Actually I've tried but no success.
By the way, David, could you also have a look at this problem, maybe you can have some ideas
http://community.infragistics.com/forums/p/65438/331336.aspx#331336
Thank you,
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?
Yes, I have the latest Service Release.
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.
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
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?
Senthil,
Could you provide me with more details about what you are seeing and how you are reproducing the behavior? How do you have the control implemented? Are you able to reproduce this in the previous sample that was provided on this thread or do you have a different sample that you could send to me?
To be able to look in to this further I need to know how you currently have the grid implemented and how you are attempting to remove the records.
Hi Jason,
I'm using infragistics 14.2.20142.2317. the issue is still presist. Unable to solve the problem.
Please give me any quick solution
Thanks,
Senthil
Hello Senthil,
This issue was fixed in build 11.2.20112.2086 as well as the release build of 2012 Vol. 1 and later. What build are you using of Infragistics for ASP.NET? Could you provide more details of what you are currently seeing and how you have your application implemented?
I'm also facing the same issue. Workaround solution is not working for me.
Please update the fix if you its already taken care.
Alexander and David,
I have created case CAS-84177-Y4RP7B for this issue. I'll be linking the development issue to that case so Alexander can be notified when the fix is available in a public service release.