Does anyone know if jqGrid inline editing throws events that can be handled? The following code is a simple example of what I’m trying to accomplish:
jQuery('#list').jqGrid('editRow', 0, true, false, false, false, {onClose: function(){alert('onClose')}}, reloadGrid);
I’d like to be able to handle an “Esc” cancel event. The onClose event is available with Form Editing:
See the respective section in jqGrid’s documentation.
but doesn’t work with inline editing and the Inline Editing documentation doesn’t supply anything event wise other than the extraparam option which is very unspecific:
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing
I haven’t been able to figure out how to utilize the extraparam options. Suggestions?
According to your link:
So this is only going to allow you to pass custom data back to the server via a POST. It will not allow you to add an event handler.
The jqGrid source code for
editRowcontains the following handler for the Escape key:So an event is raised. According to the docs:
So there is not an explicit function callback for the escape key, although pressing escape will trigger
afterrestorefunc. Unfortunately this event is also called when a row is saved via the Enter key:But if you are careful you may be able to use
afterrestorefuncto meet your needs.