jQuery UI Widgets › Forums › Grid › Grid Row Edit, Esc should truly cancel ?
Tagged: #jqwidgets-grid, cancel, grid, javascript grid, jquery grid, Row Editing
This topic contains 4 replies, has 2 voices, and was last updated by Hristo 7 years, 11 months ago.
-
Author
-
In the online demo http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/#demos/jqxgrid/rowediting.htm, if one makes changes to the cell data but then hits Esc to cancel editing, the source’s updaterow() method is still invoked. Using an enterprise version of the library, I have this event coded to submit an update to the server.
I would like the “Cancel” event not update the underlying adapter, and thus not require the submit to the server. This should be done without the need to check the existing grid data to check if all each field is unchanged.
According to the documentation (http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-api.htm), there are events for cell edits but not row edits. Seems like there would be someplace to plugin someplace. Any suggestions appreciated.
On a related note, and with the same example, clicking the checkbox immediately fires the update event. That could be useful in some circumstances, but I would have expected the row editor to open.
Direct link is http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/rowediting.htm?light
Hello toby,
We will discuss this case.
I would like to suggest you use commit(true/false) depends on value if it is changed –commit(false)
.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comSure. In the demo http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/rowediting.htm?light , I use the commit() callback with a boolean argument, based on the result of my AJAX call. No problems there.
The issue that I’m pointing out is that updaterow() is called, even when existing (ESC key) the row editor without changing any rows. Since we haven’t made any changes, I would expect this method not to be called, since nothing has changed. I think of this like the old JS confirm dialog, where hitting Cancel does not fire the event code.
if (window.confirm("Commit the records?")) { /* Did not exit, so do something */ }
Just my thoughts. I’ll explore a work-a-round this behavior isn’t implemented.
Hello toby,
Thank you for the feedback.
I created a work item for this case.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.