0
1. $("#jqgproduct").jqGrid('getGridParam', 'data').length;
2. $("#jqgproduct").getGridParam("reccount");
我試圖左右逢源以上,但它顯示0條記錄甚至認爲電網有3條記錄 這裏是我完整的代碼。請讓我知道IAM走錯了的jqGrid顯示總記錄0甚至有記錄
var colNames = ['Status',
'Project Ref',
'Name',
'Customer',
'CreatedBy',
'Creation Date',
'LastModified'];
var colModel = [
{ name: 'ProductID', index: 'StatusId', align: 'left', width: 70 },
{ name: 'ProjectReference', index: 'ProjectReference', align: 'left', width: 100, formatter: 'showlink', formatoptions: { "baseLinkUrl": "/Order/Index"} },
{ name: 'Name', index: 'Name', align: 'left', width: 150, formatter: 'showlink', formatoptions: { "baseLinkUrl": "/Order/Index"} },
{ name: 'CustomerName', index: 'CustomerName', align: 'left', width: 150 },
{ name: 'Createdby', index: 'Createdby', align: 'left', width: 150 },
{ name: 'CreatedDate', index: 'CreatedDate', align: 'left', width: 100, formatter: 'date', formatoptions: { newformat: 'm/d/Y'} },
{ name: 'LastModified', index: 'LastModified', align: 'left', width: 100, formatter: 'date', formatoptions: { newformat: 'm/d/Y'} }
];
var sortname = 'Id';
var sortorder = 'desc';
SetGrid('#jqgproduct', '', url, colNames, colModel, sortname, sortorder, -1);
var numberOfRecords = $("#jqgproduct").jqGrid('getGridParam', 'data').length;
$("#jqgproduct").getGridParam("reccount");
任何人能回答這個問題,請 – user2189168 2013-03-22 06:30:36