You found a bug! We've classified it as EXTJS-10625 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    4
    Vote Rating
    1
    akutin is on a distinguished road

      1  

    Default Can't select a range in a buffered store

    Can't select a range in a buffered store


    In this example:

    http://docs.sencha.com/extjs/4.2.1/e...th-filter.html

    Scroll to the middle of the grid, select one row and holding shift select another one a few rows below - "Ext.Error: PageMap asked for range which it does not have" is thrown, range doesn't get selected. Selection works as expected on the first page of the grid.

    *EDIT BY SLEMMON
    Tested OK in 4.2.0. Issue observed in 4.2.1.
    Inline test case:
    Code:
    Ext.define('ForumThread', {
        extend: 'Ext.data.Model',
        fields: [{
            name: 'title',
            mapping: 'topic_title'
        }, {
            name: 'forumtitle',
            mapping: 'forum_title'
        }, {
            name: 'forumid',
            type: 'int'
        }, {
            name: 'username',
            mapping: 'author'
        }, {
                name: 'replycount', 
                mapping: 'reply_count',
                type: 'int'
        }, {
                name: 'lastpost', 
                mapping: 'post_time', 
                type: 'date', 
                dateFormat: 'timestamp'
        },
            'lastposter', 'excerpt', 'topic_id'
        ],
        idProperty: 'post_id'
    });
    
    
    // create the Data Store
    var store = Ext.create('Ext.data.Store', {
        id: 'store',
        model: 'ForumThread',
        // allow the grid to interact with the paging scroller by buffering
        buffered: true,
        
        // The topics-remote.php script appears to be hardcoded to use 50, and ignores this parameter, so we
        // are forced to use 50 here instead of a possibly more efficient value.
        pageSize: 50,
    
    
        // This web service seems slow, so keep lots of data in the pipeline ahead!
        leadingBufferZone: 1000,
        proxy: {
            // load using script tags for cross domain, if the data in on the same domain as
            // this page, an HttpProxy would be better
            type: 'jsonp',
            url: 'http://www.sencha.com/forum/topics-remote.php',
            reader: {
                root: 'topics',
                totalProperty: 'totalCount'
            },
            // sends single sort as multi parameter
            simpleSortMode: true,
            
            // Parameter name to send filtering information in
            filterParam: 'query',
    
    
            // The PHP script just use query=<whatever>
            encodeFilters: function(filters) {
                return filters[0].value;
            }
        },
        listeners: {
            totalcountchange: onStoreSizeChange
        },
        remoteFilter: true,
        autoLoad: true
    });
    
    
    function onStoreSizeChange() {
        grid.down('#status').update({count: store.getTotalCount()});
    }
    
    
    function renderTopic(value, p, record) {
        return Ext.String.format(
            '<a href="http://sencha.com/forum/showthread.php?p={1}" target="_blank">{0}</a>',
            value,
            record.getId()
        );
    }
    
    
    var grid = Ext.create('Ext.grid.Panel', {
        width: 700,
        height: 500,
        collapsible: true,
        title: 'ExtJS.com - Browse Forums',
        store: store,
        loadMask: true,
        dockedItems: [{
            dock: 'top',
            xtype: 'toolbar',
            items: [{
                xtype: 'component',
                itemId: 'status',
                tpl: 'Matching threads: {count}',
                style: 'margin-right:5px'
            }]
        }],
        selModel: {
            pruneRemoved: false
        },
        multiSelect: true,
        viewConfig: {
            trackOver: false,
            emptyText: '<h1 style="margin:20px">No matching results</h1>'
        },
        // grid columns
        columns:[{
            xtype: 'rownumberer',
            width: 50,
            sortable: false
        },{
            tdCls: 'x-grid-cell-topic',
            text: "Topic",
            dataIndex: 'title',
            flex: 1,
            renderer: renderTopic,
            sortable: false
        },{
            text: "Author",
            dataIndex: 'username',
            width: 100,
            hidden: true,
            sortable: false
        },{
            text: "Replies",
            dataIndex: 'replycount',
            align: 'center',
            width: 70,
            sortable: false
        },{
            id: 'last',
            text: "Last Post",
            dataIndex: 'lastpost',
            width: 130,
            renderer: Ext.util.Format.dateRenderer('n/j/Y g:i A'),
            sortable: false
        }],
        renderTo: Ext.getBody()
    });
    Last edited by slemmon; 10 Jul 2013 at 1:03 PM. Reason: additional test notes

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,012
    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


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

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    4
    Vote Rating
    1
    akutin is on a distinguished road

      0  

    Default


    Any updates on the progress or you can advise a temporary workaround at least?

    Thanks

  4. #4
    Ext JS Premium Member
    Join Date
    Nov 2008
    Posts
    88
    Vote Rating
    0
    andrej_marincic is an unknown quantity at this point

      0  

    Default


    I'm having the same problem still in version 5.0.1 (nightly build). It looks this bug will go on forever.

Thread Participants: 2

Tags for this Thread