title: jqgrid: How to get column index use custom formatter
body: <p><strong>How to get column index use custom formatter.</strong></p>
  
  <p>In column «Tax» i try use custom formatter. Need get column index value and row index value. I can get irow parameter irow = options.rowid but problem with getting icol parameter.</p>
  
  <p>This is my example:     </p>
  
  <pre><code>    var $grid = $("#grid");
  
      $grid.jqGrid({
          datatype: "local",
          height: 250,
          colNames:[' ', 'Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
          colModel:[
              {name: 'myac', width:80, fixed:true, frozen: true, sortable:false, resize:false, formatter:'actions',
              formatoptions:{keys:true}},
              {name:'id',index:'id', width:60, sorttype:"int", frozen: true},
              {name:'invdate',index:'invdate', width:90, sorttype:"date", frozen: true, editable: true},
              {name:'name',index:'name', width:100, editable: true, editable: true},
              {name:'amount',index:'amount', width:80, align:"right",sorttype:"float", editable: true},
              {name:'tax',index:'tax', width:80, align:"right",sorttype:"float", editable: true,
  
                   formatter: function(cellvalue, options) {
                      var id = options.rowId;
                      var col;
  
                      return id ?
                             '&lt;span class="editable" data-id="' + id  + '" data-col="' + col + '"&gt;$' + cellvalue + '&lt;/span&gt;' :
                             cellvalue;
                  }
  
              },      
              {name:'total',index:'total', width:80,align:"right",sorttype:"float", editable: true},      
              {name:'note',index:'note', width:150, sortable:false, editable: true}       
          ],
          rowNum:10,
          width:700,
          rowList:[10,20,30],
          pager: '#pager',
          sortname: 'invdate',
          viewrecords: true,
          sortorder: "date",
          shrinkToFit: false,
          rownumbers: true,
          caption: "Frozen Column with Group header and custom cell formatter",
          height: 'auto',
          frozen : true
      });
  
      var mydata = [
          {id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
          {id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
          {id:"3",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
          {id:"4",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
          {id:"5",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
          {id:"6",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
          {id:"7",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
          {id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
          {id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
      ];
  
  
      for(var i=0;i&lt;=mydata.length;i++) $grid.jqGrid('addRowData',i+1,mydata[i]);
  
      $grid.jqGrid('setGroupHeaders', {
        useColSpanStyle: true, 
        groupHeaders:[
          {startColumnName: 'amount', numberOfColumns: 3, titleText: '&lt;em&gt;Price&lt;/em&gt;'},
        ] 
      });
  
      $grid.jqGrid('setFrozenColumns');
  </code></pre>
  
  <p>Use click cell event i can get col and row index.</p>
  
  <pre><code>    $grid.click(function(e) {
          var el = e.target;
              if (el.nodeName !== "TD") {
                  el = $(el,this.rows).closest("td");
              }
          var iCol = parseInt($(el).index());
          var row = $(el,this.rows).closest("tr.jqgrow");
          var rowId = parseInt(row[0].id);
  
              alert ("rowId="+rowId+"; iCol="+iCol+";");
  </code></pre>