本文由我司收集整编,推荐下载,如有疑问,请与我司联系
如何获取jqGrid的行数?
2010/04/06 57848  I would like to know how to get row count for jqGrid. I’m using rowNum: -1 so it displays all the rows. I tried using:
 我想知道如何获取jqGrid的行数。我使用rowNum: -1,因此它显示所有的行。我试着使用:
  parseInt($(“#grid”).getGridParam(“records”), 10) But it always returns 0.
 但它总是返回0。
  Thanks for the help.
 谢谢你的帮助。
  from the jqGrid documentation:
 从jqGrid文档:
如何下载javascript
 reccount (integer):
  reccount(整数):
 Readonly property. Returns the exact number of rows in the grid
 只读的财产。返回网格中确切的行数
  Note also that, as Mike commented, you need to use the getGridParam method with the records option to retrieve a count of all the rows if you are using pagination.
 还要注意,正如Mike所言,如果使用分页,您需要使用getGridParam方法和records选项来检索所有行的计数。
  2
 I tried reccount and I got zero but the following worked for me.
 我尝试了重新计数,结果是0,但是下面的方法对我有效。
 div Total subscriber count: div id=“count” /div /div  br /  div  table id=“grid” /table  /div  script type=“text/javascript”  $(document).ready(function () { $(“#grid”).jqGrid({ //Other stuff removed for brevity gridComplete: function () { $(‘#count’).html($(‘#grid’).getGridParam(‘records’)); /script  1

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。