如何计算jqGrid中的行数? [英] How to count the number of rows in a jqGrid?

查看:90
本文介绍了如何计算jqGrid中的行数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算jqGrid中的行数?

How do I count the number of rows in a jqGrid?

为了澄清,涉及的数据不多,因此网格将所有数据从单个查询中的服务器,而不是使用分页。

To clarify, there is not much data involved so the grid is pulling all of its data back from the server in a single query, instead of using pagination.

推荐答案

jQuery("#myGrid").jqGrid('getGridParam', 'records');

更新

注意确定记录数有两个参数:

Note there are two parameters to determine record count:


记录

整数

Readonly属性。给出了作为查询结果返回给服务器的记录数。

Readonly property. Gives the number of records returned as a result of a query to the server.








reccount

整数

Readonly属性。确定网格中的确切行数。不要将此与记录参数混淆。虽然在许多情况下它们可能是平等的,但有些情况则不然。例如,如果将rowNum定义为15,但是对服务器的请求返回20条记录,则记录参数将为20,但reccount参数将为15(网格将包含15条记录,而不是20条记录)。 p>

Readonly property. Determines the exact number of rows in the grid. Do not confuse this with records parameter. Although in many cases they may be equal, there are cases where they are not. For example, if you define rowNum to be 15, but the request to the server returns 20 records, the records parameter will be 20, but the reccount parameter will be 15 (the grid you will have 15 records and not 20).

这篇关于如何计算jqGrid中的行数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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