How to count the number of rows in a jqGrid?

前端 未结 6 966
名媛妹妹
名媛妹妹 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 16:02

    How about this?

    jQuery("#myGrid tr").length;
    

    Actually, you can take that a step further with the optional context parameter.

    jQuery("tr", "#myGrid").length;
    

    Either one will search for every "tr" inside of "#myGrid". However, from my own testing, specifying the context parameter is usually faster.

提交回复
热议问题