1. #1
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,994
    Answers
    381
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default Answered: [4.0.2a] Trouble refreshing a buffered store

    Answered: [4.0.2a] Trouble refreshing a buffered store


    [Ext JS 4.0.2a]
    I have a grid + store with buffered: true and pageSize: 50. I load the store using store.guaranteeRange(0, 49).
    That works to pre-load 1k records into my store, but only display 50 rendered grid rows at a time.

    I then want to refresh the grid. I'm hoping to flush the records in the store/grid and reload from the sever.

    If I use store.load() it loads the store from the server with 1k records, but also renders 1k grid rows.
    If I use store.prefetch() the store is loaded with 1k records, but nothing changes in the grid.

    What is the best way to reload the store while maintaining the buffered grid view?

  2. Quote Originally Posted by mitchellsimoens View Post
    Isn't the idea of using a buffered store is that you buffer all and the Grid will only render so many? 50 may be a little to low also
    Didn't Ed say that you were revisiting the store load semantics for buffered grids in 4.1, or some time around there? I remember him saying that you shouldn't have to have a separate means of loading a grid when buffered, as opposed to non-buffered...

    stevil

  3. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,994
    Answers
    381
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    I've tried setting the proxy's params and then using the guaranteeRange again, but it looks like since the prefetching has been done already that the guaranteeRange method doesn't do much. No second trip to the server. Thus, no refreshing of the grid's view.

    Probably there's a very straight-forward answer to this one, but it's escaped me thus far. Thoughts?

  4. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,014
    Answers
    3491
    Vote Rating
    848
    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


    Isn't the idea of using a buffered store is that you buffer all and the Grid will only render so many? 50 may be a little to low also
    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.

  5. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,994
    Answers
    381
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    So, the application is that I've got an OpenLayers map and a database of 650k customer records all geocoded. The user can zoom with the map down to a location they want records for and fetch the customer data for that geographic area. That way they can see spend data per product / customer classification and it lets them see norms per region (I cut off the fetch at 1k records just to set a ceiling).

    I need to allow them to zoom into Phoenix metro and get the pricing norms. Then they should be able to center into Santa Fe metro and see the customer population there. Each zoom/fetch would re-populate the store with then new customer data set defined by that lat/long boundaries of the given map.

    So, while I grab 1k worth of records to get pricing norms, allow for filtering by product/sales rep/business name/etc. to get aggregate data and allow for user defined filtering I don't want to bloat the DOM with unnecessarily rendered rows since the gridpanel is only about 30 rows high at a given time.

    I could increase from 50, but when I tested it (without refreshing the store) it was working splendidly so I left it at 50.

    Don't know if that helps to give some context. Also, I'm certainly open to some other solution. Just thought the buffered view was the most elegant implementation after seeing how well it handled 5k records in the examples.

  6. #5
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,994
    Answers
    381
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    Thx for looking into this with me, BTW. I really appreciate it. I've really been struggling trying to figure this one out.

  7. #6
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Answers
    15
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Isn't the idea of using a buffered store is that you buffer all and the Grid will only render so many? 50 may be a little to low also
    Didn't Ed say that you were revisiting the store load semantics for buffered grids in 4.1, or some time around there? I remember him saying that you shouldn't have to have a separate means of loading a grid when buffered, as opposed to non-buffered...

    stevil

  8. #7
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,994
    Answers
    381
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    I like the way Ed thinks on this one.

    The buffered view seems like a real DOM saver to me, but I'm stuck when the store content is dynamic per user interaction.

    Thank you both for checking on this!

  9. #8
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,014
    Answers
    3491
    Vote Rating
    848
    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


    Quote Originally Posted by stevil View Post
    Didn't Ed say that you were revisiting the store load semantics for buffered grids in 4.1, or some time around there? I remember him saying that you shouldn't have to have a separate means of loading a grid when buffered, as opposed to non-buffered...

    stevil
    4.1.0 will have so many grid enhancements
    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.

  10. #9
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,994
    Answers
    381
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    Ok. Cool. I'll hold my horses and see what drops with 4.1.
    Thx to you both for the answers. I'll consider this one "ANSWERED".

Thread Participants: 2