You found a bug! We've classified it as EXTJS-9133 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default [4.2.0 GA] Buffered store can initiate too many requests initially

    [4.2.0 GA] Buffered store can initiate too many requests initially


    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.2.0 final
    Browser versions tested against:
    • Chrome
    DOCTYPE tested against:
    • None
    Description:
    • A buffered store can initiate too many requests initially. 5 requests for a non-locking grid and 9(!) for a locking one. It is reproducible with our real test case, but it also reproducible with the Grid Tuner example. Please follow the steps to reproduce.
    Steps to reproduce the problem:
    • Open infinite-scroll-grid-tuner.html sample
    • Check "Store buffered" and set Store's pageSize to 100. Leave the rest ones by default.
    • Click the Reload button
    • Here is a log. 5 "Prefetch rows ...". It actually means 5 requests.
    • Make some column locked. I opened the infinite-scroll-grid-tuner.js and injected:
    Code:
    columnSpec = {
        locked: i == 0 ? true : false,
        ...
    • Open the Grid Tuner example, apply the same settings and click the Reload button
    • Here is a log. . 9 "Prefetch rows ...". It actually means 9 requests.
    The result that was expected:
    • 3 requests in each case.
    The result that occurs instead:
    • 5 requests for a non-locking grid.
    • 9 request for a locking grid
    Test Case:
    • Infinite Grid Scroll Tuner example. Please follow the steps to reproduce.
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

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


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,169
    Vote Rating
    674
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    The problem (at least, with the test case you posted) is that the logger is actually returning incorrect results. It does only fire off 3 requests, the logger code needs to be updated:

    Code:
    Ext.data.Store.prototype.prefetch = Ext.Function.createInterceptor(Ext.data.Store.prototype.prefetch, function(options) {
        var page = options.page;
            
        if (!this.data.hasPage(page) && !this.pageRequests[page]) {
            logPanel.log('Prefetch rows ' + options.start + '-' + (options.start + options.limit));
        }
    });
    Are you saying you have a test case that fires off too many requests?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    It is nice to find a problem in the logger

    Quote Originally Posted by evant View Post
    Are you saying you have a test case that fires off too many requests?
    I have, but the problem appears to be in our custom Proxy. I was unable to reproduce it with raw ExtJS.

    Though, testing it I faced another issue which, though, meets the thread's topic.

    If a grid has a single column and this column is locked, a Store seems trying to load all pages.

    I understand it is not so real to have a single column and make it locked, but I think it is possible. Another columns might be added on user actions.

    Probably, the problem is the fact that a grid with such a configuration doesn't render a scrollbar. So, it appears to make a Store and/or a bufferedrender plugin crazy.

    Here is a test case. Please run a bit and wait for a few seconds.

    Page
    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <title>Buffered store initiates too many requests</title>
    
        <link type="text/css" rel="stylesheet" href="../resources/css/ext-all.css" />
    
        <script type="text/javascript" src="../ext-all-debug.js"></script>
    
        <script type="text/javascript">
            Ext.onReady(function () {
                Ext.create("Ext.grid.Panel", {
                    renderTo: Ext.getBody(),
                    height: 500,
                    width: 200,
                    store: {
                        autoLoad: true,
                        buffered: true,
                        pageSize: 100,
                        fields: [{
                            name: "test"
                        }],
                        proxy: {
                            type: 'ajax',
                            url: 'GetData.ashx',
                            reader: {
                                type: 'json',
                                root: 'data'
                            }
                        }
                    },
                    columns: {
                        items: [{
                            text: "Test",
                            dataIndex: "test", 
                            locked: true
                        }]
                    }
                });
            });
        </script>
    </head>
    <body>
    
    </body>
    </html>
    ASP.NET handler
    Code:
    public class GetData : IHttpHandler
    {
    
        public void ProcessRequest(HttpContext context)
        {
            int page = int.Parse(context.Request.QueryString["page"]);
    
            object[] data = new object[100];
    
            for (int i = 0; i < 100; i++)
            {
                data[i] = new { test = string.Format("test_{0}_{1}", page, i) };
            }
    
            context.Response.ContentType = "text/plain";
            context.Response.Write(JSON.Serialize(
                new
                {
                    data = data,
                    total = 50000
                })
            );
        }
    }
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,169
    Vote Rating
    674
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Currently it's not supported to have a grid with only locked columns.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  6. #6
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Ok, clear. I think it is a very edge case and, seems, not a big problem to implement if needed. I think the scenario is achievable with ease following these steps.

    1. Set "enableLocking: true" for the grid
    2. Do not set "locked: true" for the column
    3. Add a new column
    4. Make the initial column locked by a lock call. It is private, but as far as I can see in the sources it should work well.
    http://docs.sencha.com/ext-js/4-2/#!...le-method-lock

    By the way, it would be good to get the lock method public. Why not?

    Regarding to the main problem. We were able to fix our custom proxy, it doesn't lead to excessive requests anymore. Sorry for a false report.
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

Thread Participants: 2