Rendering all rows in a grid and exporting.

The problem I am having is that I am trying to export all the rows that are in a particular grid. The code that I am using is loading 50 entries at a time (for paging) from the database using the code similar to this example:
dhtmlx.com/docs/products/dht … aging.html

The problem is that when I try to retrieve all the rows using getAllRowIds the only rows that come back are those for the current page. I tried using getRowsNum but this outputs the number of all the rows in the grid instead of just the first 50. So in a grid that has 99 rows it would out put 99 but the getAllRowIds gets only the first 50.

What do I need to do in order to get all the row ids of the grid? Do I need to load all the rows? If so how should I go about doing this?

I am currently using version: v2.5

Thanks
solouser

In case of dynamic loading there is no way to get row id if it wasn’t loaded from the server side yet. To get all rows ids you should load all of them.

I have the opposite problem. I want to get the RowIds of the rows on the current page only. A call to getAllRowIds() returns all the rows in the grid whether or not they’re on the currently displayed page.

Is there a recommended way to get a list of the RowIds on the current page?

Thanks.

You can get index of top and last rows on the page with getStateOfView() method.

var state=mygrid.getStateOfView();

If paging mode is enabled:
state[0] = number of current active page
state[1] = index of the top row in the page
state[2] = index of the last row in the page
state[3] = number of rows in grid

After that you can iterate through row indexes and fetch their ids with getRowId(ind) method