How to get a jqGrid cell value when editing

raouf picture raouf · Nov 21, 2009 · Viewed 154.4k times · Source

How to get a jqGrid cell value when in-line editing (getcell and getRowData returns the cell content and not the actuall value of the input element).

Answer

Pawel picture Pawel · Apr 7, 2011

General function to get value of cell with given row id and cell id

Create in your js code function:

function getCellValue(rowId, cellId) {
    var cell = jQuery('#' + rowId + '_' + cellId);        
    var val = cell.val();
    return val;
}

Example of use:

var clientId = getCellValue(15, 'clientId');

Dodgy, but works.