Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Temuri Imnaishvili on Jul 07, 2007 20:50
open dhtmlx forum
Paging with dynamic loading

Hi, I'm a registered user of commercial version.

I am trying setup the following scenario of paged grid.

1. I have 10 rows per screen, grid vertical scrolling is disabled and autoHeight property is set to TRUE.
2. There are 1000 records in the database;
3. I want to load only 20 records at a time (2 screens of data) by requesting: loadXML('feed.php?numberOfRows=20&offset=40')
4. I am using mygrid.enablePagingWT(true,10,...);

I'd like to use Toolbar's next page buttons to initialize loading of data that hasn't been loaded yet. I.e. when I load the page initially, pressing NEXT PAGE will not load data from the server because we have 20 records in memory. However, pressing NEXT PAGE two times should initiate XML load and fetch records from 20 to 40: ('feed.php?numberOfRows=20&offset=20').

I have spent 2 full days trying to figure that out.

Would you be able to help me with this problem.

Thank you

Answer posted on Jul 09, 2007 10:59
There two most common ways to use

a) SmartRendering - which will fetch only limited count of records from server
b) Dynamical paging, this is a paging mode where additional records requested on demand

    To init such paging mode you can use code similar to next

    grid = new...
    ...
    mygrid.enablePagingWT(true,20,3,"recinfoArea");
    mygrid.init();
    mygrid.setXMLAutoLoading("feed.php"); //set url for dynamical loading
    mygrid.loadXML("feed.php?");                //initial loading
   

The url fetched from server will have next format
    feed.php?rowsLoaded=N
where N - position from which output awaited

In any case you need not to enable autoHeight feature, because the grid will show fixed 20 records so autoheight has no sense
Answer posted by Alexandra (Support) on Dec 10, 2014 06:25

Having solved the problem mentioned above, you may also look through the possible related problems with asp.net mvc datagrid and dhtml tree.