iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi
I use ClientSideEvent "OnAddPendingChanges" for validation.
How can i undo current changes? rowChange.Row.UndoChanges() doesn't work!
Thanks
Michael
The “rowChange.Row.UndoChanges();” works on my end.
I’m currently use WebGrid 7.0 build 308 and WebUI.NET Framework 3.0 build 706.Could you please let me know your currenct build version of WebGrid 7.0 and WebUI.NET Framework 3.0?
Hi Yudi
I’m currently use WebGrid Version 7.0.7200.306 and WebUI.NET Framework 3.0.5000.705.
After rowChange.Row.UndoChanges() the red Cross will be deleted, but the row is still red and the pending changes have not been updated as well.
Michael, have you tried to return false in the event? It should cancel the add changes process.
Hi James
That doesn't work correctly. Please have a look on attached picture.
I have deleted 3 rows. On last row i have return false. Pending Changes are correct, but the row is still red and the rowheader has change.
Regards
Please try to use “Refresh” method in order to revert back the deleted row style of batch update into normal row when undo changes on client side event.
The snippet code below is a simple sample that shows how to revert back the deleted row style of batch update into normal row when undo changes on client side event. The snippet code will prevent user to delete the original record of “Shippers” table of Northwind database. For more detail, please check the attached sample.
function WebGrid1_OnAddPendingChanges(controlId, table, rowChange) { var WebGrid1 = ISGetObject(controlId); if (rowChange.RowState == "Deleted") { var CompanyName = rowChange.Row.GetCells().GetNamedItem("CompanyName").Text; var e = window.event; if (CompanyName == "Speedy Express" || CompanyName == "United Package" || CompanyName == "Federal Shipping") { rowChange.Row.UndoChanges(); WebGrid1.Refresh(); return false; } } return true; }
If i refresh grid, i lost all (deleted) row styles!
Following situation:
I want delete 2 rows
First row can be deleted -> OnAddPendingChanges retruns true, row has "deleted row style"
Second row can't be deleted -> OnAddPendingChanges retruns false (gird will be refreshed and all deleted row styles are cleared!
Michael,
Okay, I think using the UndoChanges() method as you figured out originally should do it. But call it in a timeout, not in the synchronous execution.
Example:
setTimeout( function() { rowChange.Row.UndoChanges(); }, 10);
Let me know if that works in your end.
Hope this helps,James.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname