How to count the number of rows in a jqGrid?

前端 未结 6 941
名媛妹妹
名媛妹妹 2020-12-28 15:06

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 qu

6条回答
  •  醉梦人生
    2020-12-28 15:52

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

    Update

    Note there are two parameters to determine record count:

    records

    integer

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


    reccount

    integer

    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).

提交回复
热议问题