开发者

click on a empty jqgrid

开发者 https://www.devze.com 2023-03-05 03:10 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消