jqGrid獲取表資料
阿新 • • 發佈:2018-12-21
//獲取Grid所選行的ID
var GridId=$(grid_selector).jqGrid('getGridParam','selrow');
//通過GridId獲得所選行資料
var selectRow = $(grid_selector).jqGrid('getRowData',GridId);
//console.log(selectRow.id);
//console.log(selectRow['id']);
var id = selectRow.id;
jqGrid自帶多選,實現單選的方法;
以下三個屬性缺一不可:
[html] view plain copy
multiselect: true,
multiboxonly:true,
beforeSelectRow: beforeSelectRow,//js方法
[html] view plain copy
function beforeSelectRow()
{
$("#jqgridId").jqGrid('resetSelection');
return(true);
}