1. #1
    Ext GWT Premium Member
    Join Date
    May 2011
    Location
    Oslo, Norway
    Posts
    7
    Vote Rating
    2
    Ueland is on a distinguished road

      0  

    Question Best way to auto load more data into a grid

    Best way to auto load more data into a grid


    Hi!

    I have been playing with the idea to get data auto loaded into a grid when the user scrolls towards the bottom. I added a listener for scrollevents on the grid and could load more data into it, but:

    1) I cannot append data to the grid, only load data again with N more rows. Is there a append feature i have not seen?

    2) When the data is loaded, it auto-scrolls back to the top, which again triggers the scroll-event. How can i keep the user at the location he/she was at? It feels a bit hacky to save location before loading more data and it wont work well since a mouse scroll will trigger the listener many times before new data is loaded.

    Is there something better to use, perhaps liveGrid?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I don't have docs for Ext JS 2 but in Ext JS 3, in the load method you can pass a config object and one of the configs is 'add' which if set to true it will append the data instead of replacing the current dataset.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext GWT Premium Member
    Join Date
    May 2011
    Location
    Oslo, Norway
    Posts
    7
    Vote Rating
    2
    Ueland is on a distinguished road

      0  

    Default


    Thanks for the suggestion!

    I did a test with LiveGrid and it works just as i want to, and it gives me the wanted features without giving the issue with the browser jumping back to the top of the grid.

Thread Participants: 1

Tags for this Thread