I have two questions reagarding context menu for jqGrid:
I have an empty grid, and I want a context menu to appear when I click on the grid itself, or on the columns header, currently the context menu is only when I have rows inside the grid. So how can I do this?
I have another grid inside a dialog window:
$('#company_grid').contextMenu('grid_contextmenu', { bindings: { 'add_row': function(t) { }, 'delete_row': function(t) { } }); $(function() { $( "#company" ).dialog( { autoOpen: false, height: 500, width: 900, modal: true, resizable: false, open: function(event, ui) { $("#company").setGridWidth($(this).width()-2 ); $("#company").setGridHeight($(this).height()-100); } }); }); <div id="company"> <table id="company_grid"></table> </div> <div class="contextMenu" id="grid_contextmenu"> <ul> <li id="add_row"> Add Row </li> <li id="delete_row"> Delete Row </li> </ul> </div>
When the dialog is opened, I can't see the context menu. I realized that it appears behind the dialog. So what am I doing wrong? How can I add a context menu to the dialog grids?
http://stackoverflow.com/questions/6607576/how-to-create-jqgrid-context-menu and bind it to the grids th elements. – rqmedes Nov 19 '11 at 00:59