Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext JS Premium Member
    Join Date
    Jul 2011
    Posts
    29
    Vote Rating
    2
    beckdawg is on a distinguished road

      0  

    Default Unanswered: Prefetching a store with pagination

    Unanswered: Prefetching a store with pagination


    I have a grid with paging. That works fine. However, it doesn't print friendly. So, what I would like to do is grab all the data back from the controller then use that to draw a html table as needed. I thought what would make sense is to just prefetch the data and save that to a variable like so.
    Code:
    var all = store.prefetch({
            action:'read',
            limit: 1000,
            start: 0,
        }).prefetchData;
    This actually works. However, it breaks the pagination. My store is set up like this
    Code:
    Ext.create('Ext.data.Store', {
            pageSize: 25, 
            model: 'model', remoteSort: true, buffered: true, purgePageCount: 0,
            proxy: new Ext.data.HttpProxy({
                method: 'GET', type: 'jsonp', simpleSortMode: true,
                extraParams: { var1: value, var2: value2 },
                reader: { root: 'root', totalProperty: 'totalCount' },
                url: url
            })
        });
    If I don't do some form of load nothing displays in the grid. If I do store.load() it will load all of the records into the grid instead of paging at 25. I don't really get that because there is a prefetchPage method on store. So, I would expect prefetch to allow you to prefetch any range you want. I've also tried loadPage, and nextPage for giggles.

    I'm wondering if I'm using this wrong. It seems as though it's for someone to load the first n records and then have a loop that renders data behind things for something like buffered grid. However, it seems rather unfortunate that this apparently doesn't work with paging.

    What would be nice is if I could simply load my data once in a single server call. The only way that seems to work(with sorting, filtering, and paging) is if display everything which has slow render time over large data sets. The only real way around slow render is paging or some sort of buffering. Buffering doesn't work well with filtering since it's over cached data. Just feels like I'm running in circles trying to get this all to work together. I have the grid working by doing everything server side but something as simple as trying to save all the data to a variable without making 2 calls to the server breaks down. Just seems painfully rigid working with this.

    I guess what I'm asking here is there some better way to do all of this? Searching google/forums hasn't yielded me much that even works let alone works well.

  2. #2
    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


    It's definitely a complicated situation when you have seemingly conflicting requirements (need all data to print, but that's too expensive to browse/render) that actually make perfect sense. I would imagine this specific case to be very common in applications - I haven't solved the grid print dilemma in my own app, but I can appreciate it.

    It seems to me as though prefetchPage is there more for buffering and infinite scrolling, and you might be fighting the framework there.

    I would probably balance the needs of the two by creating two Stores - one for viewing, which is attached to the grid and has the page size you want, and one for printing, which is free-standing, and has an arbitrarily large <limit> on its params.

    When you're ready to print, set the current viewable filters/sorts onto the printing Store, and tell it to load({ page: 0, start: 0, limit: 10000000}).

    This is still multiple calls, but at least you have the data separated by need.

    One clarifying question - you mention "slow render" - by that, are you referring to the server taking a long time to complete, or to a long delay in getting the rows displayed once the response arrives? If it's the latter, there is a LOT of performance rework that is going into 4.1 next month...

    stevil

  3. #3
    Ext JS Premium Member
    Join Date
    Jul 2011
    Posts
    29
    Vote Rating
    2
    beckdawg is on a distinguished road

      0  

    Default


    Quote Originally Posted by stevil View Post
    One clarifying question - you mention "slow render" - by that, are you referring to the server taking a long time to complete, or to a long delay in getting the rows displayed once the response arrives? If it's the latter, there is a LOT of performance rework that is going into 4.1 next month...
    I've not debugged it a great deal but I think the render issue I'm referring to is just slow draw time by javascript. The grid we're using has 500 rows and 8 columns per row. The draw time in chrome and firefox seems acceptable but IE lags a bit(unsurprisingly) and our QA/BA's don't feel that's acceptable. So, we put in paging to resolve that.

    Hopefully 4.1 will resolve some of the issues. In my case atm, I think what I'm going to do is make a simple AJAX request and run and each function over it rather than involving a store.

  4. #4
    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


    If it's rendering performance in IE, I probably would advise you not to build too much infrastructure to work around, it, as it should be resolved in 4.1 for sure.

    An Ajax request seems like it would certainly fill the bill, at the cost of being less elegant than you'd prefer.

    stevil

Thread Participants: 1