1

long story short, when I'm trying to get value of any column with this

var Id=jQuery("#grid").jqGrid('getCell',id,'Id');

I'm getting this value

<INPUT style="WIDTH: 98%" id=2_Id class=editable role=textbox value=86 name=Id>

and i"m expecting 86 only. any guess what is wrong?

tereško
  • 57,247
  • 24
  • 95
  • 149
Piyush Sardana
  • 1,761
  • 4
  • 19
  • 33

2 Answers2

0

Its getting the content inside as text, which in this case is the control. You can use

var Id=jQuery("#grid").jqGrid('getCell',id,'Id').attr("value");

if that suffices.

Ashwin Singh
  • 6,987
  • 4
  • 34
  • 55
0

var rowData = $("#jqGridTableId").getRowData(rowId);

rowData will be like: Object {seriesId: "", name: "<input type='text' value='Initial Jobless Claims' id='txtChartSeriesName_0'">}

To get value of this html element from rowData....you can have a simple code like: $(rowData.name).val()

Parveen Verma
  • 15,330
  • 1
  • 13
  • 18