var rowdata;
var records = $("#tblWorkGroupDetails").getGridParam("reccount");
for (var i = 0; i < records; i++) {
var index = i;
var rowId = jQuery('#tblWorkGroupDetails tr:eq(' + index + ')').attr('id');
rowdata = $('#tblWorkGroupDetails').getCell(rowId, 'groupname') + "," + $('#tblWorkGroupDetails').getCell(rowId, 'workcode');
}
将rowdata视为'false,false'。任何人吗?
答案 0 :(得分:0)
将.length
用于records
等
for (var i = 0; i < records.length; i++) {
var index = i;
var rowId = jQuery('#tblWorkGroupDetails tr:eq(' + index + ')').attr('id');
rowdata = $('#tblWorkGroupDetails').getCell(rowId, 'groupname') + "," + $('#tblWorkGroupDetails').getCell(rowId, 'workcode');
}
此外,检查rowId
中的值。
答案 1 :(得分:0)
var rowData = $("#tblWorkGroupDetails").jqGrid('getRowData', rowId);
to access each column value say,
rowData.name