title: Adding a Context Menu to jqGrid's onRightClickRow
body: <p>I am having difficulties adding a context menu to my jqGrid within the onRightClick event.  After right clicking on a cell I would like to get the rowid, iRow, and iCol values from the onRightClickRow event.</p>
  
  <p>However, the problem that I am experiencing is that the first time I right click on a cell in the grid the context menu does not appear.  The second time that I right click on a cell the context menu is displayed, but the rowid, iRow, and iCol values are all for the first cell that was right clicked.  So the rowid, iRow, and iCol never match up with the cell that is right clicked.</p>
  
  <p>For the context menu I am using jquery.contextmenu.r2.js</p>
  
  <p>Here is the jqGrid code that I have.</p>
  
  <pre><code>jQuery("#list").jqGrid({
      url:urlPath,
      datatype:"json",
      mtype:'GET',
      jsonReader: {
          root: function (obj) { return obj.result; },
          id: dataID,
          repeatitems: false,
          page:  function(obj) { return 1; },
          total: function(obj) { return 1; },
          records: function(obj) { return obj.result.length; }        
      },
      colNames: columnNames,
      colModel: columnModel,
      onRightClickRow: function (rowid, iRow, iCol, e) {
          jQuery("#list").contextMenu('rightClickMenu', {
              bindings: {
                  'DisplayiRow': function(t) {
                      alert('DisplayiRow: ' + iRow);   
                  },
                  'DisplayiCol': function(t) {
                      alert('DisplayiCol: ' + iRow);
                  }
              }
          })
      },
      scroll:1,
      headertitles: true,
      pager: '#pager',
      shrinkToFit: false,
      autowidth: true,
      height: gridHeight,
      sortable: true,
      sortorder: 'desc',
      viewsortcols:[true,'vertical', true],
      viewrecords: true,
      gridview: true,
      loadonce: true
    });
    jQuery("#list").jqGrid('filterToolbar', {searchOnEnter:false,defaultSearch:'cn'});
  });
  </code></pre>
  
  <p>HTML is</p>
  
  <pre><code>&lt;div class="contextMenu" id="rightClickMenu" style="display:none"&gt;
      &lt;ul&gt;
         &lt;li id="DisplayiRow"&gt;
             DisplayiRow&lt;/li&gt;
         &lt;li id="DisplayiCol"&gt;
             DisplayiCol&lt;/li&gt;
     &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Is there a way to add in a right click Context menu to the onRightClickRow event so that I can get the rowid, iRow, and iCol values of the cell that was clicked?</p>