Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tom H on May 06, 2008 23:55
open dhtmlx forum
Way to get actual row count in grid with enableBuffering() enabled?

I'm a licensed enterprise customer for the 1.5 dhtmlxgrid product trying to deal with some large grids in my app. The enableBuffering() call works great for displaying the grid initially without having to process all the rows prior to scrolling.

As the user selects rows in the grid, I need to be able to scan through the other rows in the grid basically to look for related/matching rows. The grid's getNumRows() method returns the total number of rows - if I iterate through the rows I eventually get the "Row not exists" [sic] error.

I've tried setOnLoadingEnd which passes the count of nodes added to the grid - but that seems to batch the total number of rows in XML data and not the number of rows rendered in the grid.

Is there anyway to find out how many rows have been rendered? Or am I stuck trying to trap the "Row not exists" error and handling that programmatically instead of showing it to the user?

thanks,
Tom
Answer posted by Support on May 07, 2008 02:23
The total count of rows in grid can be taken as
    grid.getRowsNum()

The count of rendered rows, in case of buffering can be taken as
    grid.rowsCol.length
Answer posted by Tom H on May 07, 2008 09:53
grid.rowsCol.length works great.  Is that an internal thing that might change in future versions of the grid though?

thanks,
Tom
Answer posted by Support on May 08, 2008 04:15
This is an inner row collection, it will work the same for next version of grid and most probably will not change in foreseen future