关于jqgrid获取某一行某一列的值

 

varrowdata=jQuery("#list").jqGrid('getRowData',num);
var emergencySencondMgrId = rowdata["emergencySencondMgrId"];//
列名和jGrid定义时候的值一样
alert(emergencySencondMgrId);

1.获得当前列表行数:$("#gridid").getGridParam("reccount");

2.获取选中行数据(json):$("#gridid").jqGrid('getRowData', id);

3.刷新列表:$(refreshSelector).jqGrid('setGridParam',{ url: ''), postData: ''}).trigger('reloadGrid'); 

4.选中行:$("#jqGrid").setSelection("1",true);   (Toggles a selection of the rowwith id = rowid; if onselectrow is true (the default) then theevent onSelectRow is launched, otherwise it is not.)//true:重新加载表格数据, false:不重新加载表格数据

5.重置选中行:$("#jqgrid").resetSelection();//Resets (unselects) the selected row(s). Also works in multiselect mode.

6.清除:$("#jqgrid").clearGridData();   //Clearsthe currently loaded data from grid. If the clearfooter parameter is set totrue, the method clears the data placed on the footer row.

7. $("#jqgrid").setCell(rowid,colname,nData,cssp,attrp); 

//This method can change the contentof particular cell and can set class or style properties. Where: 

rowid the id of the row, 
colname the name of the column (this parameter can be a number (the indexof the column) beginning from 0 
data the content that can be put into the cell. If empty string thecontent will not be changed 
class if class is string then we add a class to the cell using addClass;if class is an array we set the new css properties via css 
properties sets the attribute properies of the cell, 

forceup Ifthe parameter is set to true we perform update of the cell instead that thevalue is empty 

 

8.获取选中行ID

 var rowid =$("#jqgrid").jqGrid('getGridParam','selrow'); 

var rowid =$("#searchResultList").getGridParam("selrow");
var rowData = $("#searchResultList").getRowData(rowid); /
根据行ID,获取选中行的数据(根据)

//获取选中的多行ID列表
var selectedIds  =jQuery("#stationList").jqGrid("getGridParam","selarrrow");
允许多行选择时使用

你可能感兴趣的:(关于jqgrid获取某一行某一列的值)