how to get this row count for jquery grid..

Posted by kumar on Stack Overflow See other posts from Stack Overflow or by kumar
Published on 2010-06-02T11:54:31Z Indexed on 2010/06/02 13:13 UTC
Read the original article Hit count: 796

Filed under:
|

I used this code to get the count of records in the jquery grid

var numRows = jQuery("#mygrid").jqGrid ('getGridParam', 'records');

when i place anywhere in my view after or before grid?? am allways geting 0 result.. bec its allways taking before grid loading..

i need to place this code where i need to check after grid loading..

if i put something like this.

alert("hello");

 var numRows = jQuery("#mygrid").jqGrid ('getGridParam', 'records');
 alert(numRows);

first if i keep any alert message and then if i count i am getting the number of records..

but if i give directly this code

var numRows = jQuery("#mygrid").jqGrid ('getGridParam', 'records');
     alert(numRows);

i am getting out put as 0.. i dont know why its behaving like this.. if we keep first alert box anywhere for second alert box i am getting rowcounts..

can anybody help me out ..

thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jqgrid