【问题标题】:Jqgrid showing total records 0 even it has recordsJqgrid 显示总记录 0 即使它有记录
【发布时间】:2013-03-09 00:41:29
【问题描述】:
    1. $("#jqgproduct").jqGrid('getGridParam', 'data').length;
    2. $("#jqgproduct").getGridParam("reccount");

我尝试了以上两种方式,但即使网格有 3 条记录,它也显示 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");

【问题讨论】:

  • 谁能回答这个问题

标签: mvcjqgrid


【解决方案1】:

试试这个:

 var recCount=$( '#jqgproduct' ).jqGrid( 'getGridParam', 'reccount' );

【讨论】:

    猜你喜欢
    • 2017-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多