0

I have two questions reagarding context menu for jqGrid:

  1. 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?

  2. 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">&nbsp;Add Row&nbsp;</li>
            <li id="delete_row">&nbsp;Delete Row&nbsp;</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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user590586
  • 2,960
  • 16
  • 63
  • 96
  • See this answer
    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

1 Answers1

0

I'm guessing that all the dialog boxes in jQuery are controlled by CSS.

Maybe you could try changing the z-index value of your context menu to make it pop-over your dialog ?

Monkios
  • 153
  • 4