I am working on an MVC project, which uses JQGrid. In开发者_运维技巧 one of my grids, I have a subgrid. Within the subgrid one of the columns is a dropdownlist. I would like to catch the change event of this dropdownlist, so that I can set a default value of the next cell along using the selected item.
I used Firebug to see the Id of the <select>
html, and tried the following code, which doesn't fire the alert:
$('#MySelectId').change(function() {
alert('Test');
});
This approach worked when using the modal edit form, but I am using inline editing, and would like to catch the event when the user changes the dropdownlist on the grid.
You can define dataEvents
property as the part of editoptions. In the dataEvents
you defines your custom 'change' event handle and jqGrid will make the binding after the corresponding cell will be initialized in the editing mode. See here or here examples.
精彩评论