-
3 Feb 2013 12:08 PM #1
bufferedrenderer throws Error when invoking grid.reconfigure
bufferedrenderer throws Error when invoking grid.reconfigure
Ext version tested:
- Ext 4.2.0.265
- Chrome
- grid.reconfigure(newStore) does not work for grids with bufferedrenderer plugin.
- try the example code
- also try scrolling down before pressing the button
- commenting out the bufferedrenderer plugin "fixes" the problem
[B]The result that was expected:- look at the behavior without the bufferedrenderer plugin. That's what I want. The grid has only 10 rows.
- The grid has an arbitrary number of rows and scrolling back to top, I don't see any rows.
Code:function createStore(numRecords) { var records = []; for (var i = 0; i < numRecords; i++) { records.push({ name : 'Lisa' + i, email : 'lisa@simpsons.com' + i, phone : '555-111-1224' + i }); } return Ext.create('Ext.data.Store', { fields : ['name', 'email', 'phone'], data : { items : records }, proxy : { type : 'memory', reader : { type : 'json', root : 'items' } } }); } var grid = Ext.create('Ext.grid.Panel', { title : 'Simpsons', plugins : 'bufferedrenderer', store : createStore(1000), height : 200, width : 400, renderTo : Ext.getBody(), columns : [ { text : 'Name', dataIndex : 'name' }, { text : 'Email', dataIndex : 'email', flex : 1 }, { text : 'Phone', dataIndex : 'phone' } ], tbar : [ { xtype : 'button', text : 'Reconfigure', handler : function () { grid.reconfigure(createStore(10)); } } ] });
-----
By the way: BufferedRenderer.getViewRange() will return undefined if the store has a cache miss. This leads to an error:
Uncaught TypeError: Cannot read property 'length' of undefinedAbstractView.js:504
Code:/*BufferedRenderer.js*/ getViewRange: function() { var me = this, rows = me.view.all, store = me.store; if (store.data.getCount()) { return store.getRange(rows.startIndex, rows.startIndex + me.viewSize - 1); // may return undefined! } else { return []; } },
-
4 Feb 2013 7:09 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,666
- Vote Rating
- 435
Thanks for the report! I have opened a bug in our bug tracker.
You found a bug! We've classified it as
EXTJSIV-8514
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote