1. #1
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    54
    Vote Rating
    0
    pm100 is on a distinguished road

      0  

    Default cant make infinte grid work

    cant make infinte grid work


    My infinite grid app no longer works. I have changed it to mathc the new calls in the infinte grid demo but it still doesnt work. Now it could be that my proxy (its my own customer proxy) is the piece thats failing.

    As far as I can see the store, scroller or grid did not see the operation end (LoadMask is displayed). I see the store onProxyPrefetch being called so we get a long way into post-processing but its hard to follow from there given that something is not being called (cant put a breakpoint on it!)

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,620
    Vote Rating
    817
    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


    Any errors? Kind of hard to help with just saying it's not working.
    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 JS Premium Member
    Join Date
    Oct 2011
    Posts
    54
    Vote Rating
    0
    pm100 is on a distinguished road

      0  

    Default


    The behavior I see is that the 'loading' mask is shown on the grid and then nothing

    My proxy is called and returns the data

    the prefetch works, the cb from that calls guaranteeRange; which also works. All looks good (I have the correct number of records in the store etc) but nothing gets displayed, the pagingscroller gets it onGuaranteeRAnge called

    I have changed the load sequence slightly so that the grid gets rendered before the store is assigned - in that case I never get the loading mask, but the rest of the behavior is the same

    I am trying to step through the working infinite grid demo and see where my code diverges

  4. #4
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    54
    Vote Rating
    0
    pm100 is on a distinguished road

      0  

    Default


    ok - I cracked this one. Because reconfigure can no longer be made to work with infinite grid I changed my app to make a new grid each time I display fresh data. I was drawing it wrong

    now my problem is that page 2 doesnt display :-(

    I'll work that one out

  5. #5
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    54
    Vote Rating
    0
    pm100 is on a distinguished road

      0  

    Default


    Well now I am confused by the page 2 issue

    the scroller calls guaranteeRange with start = 36, end = 85 (I have page size = 50)

    gr in store does

    start = Math.min(Math.max(start - me.numFromEdge - ((me.leadingBufferZone - me.trailingBufferZone) / 2), 0), me.totalCount - me.pageSize);

    the answer to this is 0

    so it now tries to prefetch rows 0-49; which it already has so no IO gets done. (Note that the loadmask is not turned off in this code path)

    I dont understand that calculation but its certainly wrong

  6. #6
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    65
    Vote Rating
    1
    kevhender is on a distinguished road

      0  

    Default


    I am seeing issues with this too. I am prefetching 100 items per page, and there are about 330 total items. When I scroll down past the first 100 prefetched items, the loadmask doesn't appear but the next 100 items are correctly loaded. Then if I slowly scroll down further, the loadmask finally appears but there is nothing to load now, so the grid gets stuck just on the loadmask.

    Like pm100 said, there is some goofy calculation somewhere that isn't quite right...

  7. #7
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    54
    Vote Rating
    0
    pm100 is on a distinguished road

      0  

    Default


    I found that setting the pagesize really doesnt work. You have to let the grid work it out for itself

    You do then end up with 2 other issues (reported elsewhere by me)

    a) The grid will refetch the data from the store if you scroll up and down a little even though its in the stores cache. This happens if the totalCount for the data set is < the calculated page size

    b) the last row is not displayed. This is the result of another set of complicated calculations

  8. #8
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    65
    Vote Rating
    1
    kevhender is on a distinguished road

      0  

    Default


    Ok, I figured out a sorta hackish way to fix this, maybe somebody can tell me if this is "acceptable" or if there is something else I should be doing. It seems like you have to directly access the PagingScroller so that it is initialized.

    First, I had to add these config params to my store (it was using the store's values for these, rather than the PagingScroller's values):
    Code:
    leadingBufferZone: 15,
    trailingBufferZone: 5
    Previously, I was doing this in the initComponent of my grid:
    Code:
    me.store.prefetchPage(1, {
        start: 0,
        limit: 100,
        callback: function() {
            me.guaranteeRange(0, 99);
        }
    });
    I changed it to this, and it seems to be working right now:
    Code:
    me.store.prefetchPage(1, {
        start: 0,
        limit: 100,
        callback: function() {
            me.verticalScroller.doAttemptLoad(0, 99);
        }
    });

Thread Participants: 2