1

I have try to get cell data on gridComplte event but I am not able to getting a value of cell so,please suggest me how to get that?

gridComplete: function () 
    {
         var ids = jQuery("#list").jqGrid('getDataIDs');
         alert(ids);
        for(var i=1;i<=ids.length;i++)
        {
            var rowId = ids[i];
           // var rowData = jQuery('#list').jqGrid ('getRowData', rowId);
            var cont = jQuery('#list').getCell(rowId, 'SYS');  //SYS is my colNames
            var val = $(cont).val();
            alert(val);
        }
    },
Niels
  • 48,601
  • 4
  • 62
  • 81
AloNE
  • 311
  • 3
  • 7
  • 15
  • It's not full clear what you need, but probably what you do will be better implemented using [getCol](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods) method? – Oleg May 13 '13 at 06:34
  • http://stackoverflow.com/questions/15285282/jqgrid-gridcomplete-getrowdata-get-row-cell-value-from-array – LCJ Jul 27 '15 at 01:50

1 Answers1

1

In your code above, variable "cont" should have the value of 'SYS' column. Remove the line

var val = $(cont).val();

Here is the corrected code:

gridComplete: function () 
{
     var ids = jQuery("#list").jqGrid('getDataIDs');
     alert(ids);
    for(var i=1;i<=ids.length;i++)
    {
        var rowId = ids[i];
       // var rowData = jQuery('#list').jqGrid ('getRowData', rowId);
        var cont = jQuery('#list').getCell(rowId, 'SYS');  //SYS is my colNames
        alert(cont);
    }
},
RRK
  • 465
  • 2
  • 7
  • 21