Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a jqGrid cell value when editing

Tags:

cell

jqgrid

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).

like image 525
raouf Avatar asked Nov 21 '09 13:11

raouf


People also ask

How do I get the value of a jqGrid cell?

How to get a cell value in JQGrid? var ret = jQuery("#MyGrid"). jqGrid('getRowData', id); ret = ret.

How do I make a jqGrid cell editable?

In the demo the cells from the 'Client' column having the text "test" will be marked as "non-editable". Later one can make the cells "editable" or "non-editable" be clicking on the corresponding button.

How do you use jqGrid?

In this step, we are going to add jqGrid Script and CSS reference to index view. This script is added to project when we add jqGrid Grid from NuGet package. After adding Scripts and Css next we need to add table element for reserve the place where the grid should be created.


1 Answers

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.

like image 84
Pawel Avatar answered Sep 21 '22 16:09

Pawel