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
  • 58,060
  • 25
  • 98
  • 150
Piyush Sardana
  • 1,748
  • 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
  • 7,197
  • 4
  • 36
  • 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
  • 16,690
  • 1
  • 14
  • 19