的jqGrid显示总记录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");
答
试试这个:
var recCount=$('#jqgproduct').jqGrid('getGridParam', 'reccount');
任何人能回答这个问题,请 – user2189168 2013-03-22 06:30:36