click on a empty jqgrid
Can anyone please tell how to get the click event of an empty grid. i have an empty grid, and after开发者_如何学Go inserting i need to refresh the grid for that i use a right click menu in the grid. So at first there will be no data and need a click event of the grid,
Thanks, Devan
It seems to me that you should trigger 'reloadGrid' after the filling of the grid.
If you do need implement 'click' or 'right click' event handler to the whole grid and not only the grid body you can use gbox div which will be constructed by jqGrid and which includes all jqGrid elements (see here for details):
var myGrid = $("#list");
// ...
$('#gbox_'+myGrid[0].id).click(function(e) {
alert("click!");
}).bind('contextmenu', function(e) {
alert("right click!");
});
See the corresponding demo here.
精彩评论