JQGrid传呼机说"1之南"? [英] JQGrid pager says "1 of Nan"?

查看:83
本文介绍了JQGrid传呼机说"1之南"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我没有返回任何行时,我们的jqGrid传呼机说Page 1 of NaN.

When I have no rows returned, our jqGrid pager says Page 1 of NaN.

返回的JSON是:

{"page":"1","records":"0","total":"1"}

为什么列出NaN?

更新:我们仅在使用loadonce:true时才出现此问题.

Update: We only seem to have this issue when we use loadonce:true.

这是源代码:

  $("#list").jqGrid({
    url:'NoData.json',
    datatype: 'json',
    mtype: 'GET',
    colNames:['Product', 'Type'],
    colModel :[
      {name:'product', index:'product', width:80},
      {name:'type', index:'type', width:55, align:'right'},
    ],
    pager: '#pager',
    rowNum:20,
    viewrecords: true ,
    caption: 'Positions',
    height: '460',
    loadonce:true,          
    hidegrid: false         
  });


更新2 :下面的JSON似乎有用,对吗?


Update 2: What seems to work is the JSON below - is this right?

{"page":0,"records":0,"total":0,"rows":[]}

推荐答案

jqGrid的定义有误.查看填充了JSON数据的jqGrid的简单示例.您将在grid.locale-XX.js(例如,grid.locale-en.js)中定义的$.jgrid.defaults.emptyrecords中看到无记录可查看"或其他文本.

Something is wrong in the definition of your jqGrid. Look at the simple example of jqGrid filled with your JSON data. You will see "No records to view" ar other text from $.jgrid.defaults.emptyrecords defined in grid.locale-XX.js (grid.locale-en.js for example).

如果您仍然遇到问题,则应在问题所在的jqGrid代码后面附加问题.

If you will continue to have problem you should append your question with the code of the jqGrid having the described problem.

这篇关于JQGrid传呼机说"1之南"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆