If I understand your problem correctly, you can do the following:
var rowData = $("#rowed5").jqGrid("getLocalRow", rowid); alert("data3=" + rowData.address.data3);
By the way, to save the address part, you donโt need to create a hidden "address" column. This way, you are not creating a hidden column in the table to store any special row-specific data. You should just populate the data as you would, as usual: using the data option for jqGrid:
var mydata = [ { id: "10", "datamain": "mydata", "address": {"data1": 15, "data2": 0.0, "data3": "1000"} }, { id: "20", "datamain": "mydata2", "address": {"data1": 18, "data2": 0.1, "data3": "3000"} } ]; $("#rowed5").jqGrid({ datatype: "local", data: mydata, colNames: ['Name'], colModel: [ {name: 'datamain', width: 300, editable: true} ], height: "auto", ... });
In case, all data will be stored in the internal parameter data jqGrid. You can use $("#rowed5").jqGrid("getGridParam", "data") to return all the data or use $("#rowed5").jqGrid("getLocalRow", rowid) to return data only the specified strings.
A small demonstration demonstrates a lively approach. Data is displayed on one line per page. Thus, you can go to the next page and change the data by editing the cell. After saving the information, the โaddressโ from the current cell will be displayed.
Oleg Oct 17 '12 at 12:16 2012-10-17 12:16
source share