PDA

View Full Version : [INFOREQ] GridView / GridPanel 'bufferedRenderer' always defined in latest nightly



mankz
28 May 2014, 9:41 PM
Is this intentional, it's always having a bufferedRenderer now? In previous builds and in Ext 4 we could find if a view was buffered or not using


if (view.bufferedRenderer) {...

If it's always there, how can we know if buffered rendering is active or not?

mitchellsimoens
29 May 2014, 4:04 AM
I'm seeing where RowModel and Grouping feature have the conditional but nothing that says the grid will always have a buffered renderer.

mankz
29 May 2014, 6:15 AM
Read the nigthlies Ext.panel.Table code.



initComponent: function() {
if (this.verticalScroller) {
Ext.Error.raise("The verticalScroller config is not supported.");
}
if (!this.viewType) {
Ext.Error.raise("You must specify a viewType config.");
}
if (this.headers) {
Ext.Error.raise("The headers config is not supported. Please specify columns instead.");
}
if (this.deferRowRender) {
Ext.Error.raise('The deferRowRender is deprecated and ignored now. The initial refresh occurs during grid render.');
}

var me = this,
headerCtCfg = me.columns || me.colModel || [],
view,
i, len,
bufferedRenderer,

store = me.store = Ext.data.StoreManager.lookup(me.store || 'ext-empty-store'),
columns;

me.enableLocking = me.enableLocking || me.hasLockedColumns(headerCtCfg);









if (me.plugins) {
me.plugins = me.constructPlugins();
}


if (me.columnLines) {
me.addBodyCls(me.colLinesCls);
}

me.addBodyCls(me.rowLines ? me.rowLinesCls : me.noRowLinesCls);
me.addBodyCls(me.extraBodyCls);




if (me.enableLocking) {
me.self.mixin('lockable', Ext.grid.locking.Lockable);
me.injectLockable();
}

else {

if (headerCtCfg.isRootHeader) {
me.headerCt = headerCtCfg;

me.headerCt.forceFit = !!me.forceFit;


me.columnManager = headerCtCfg.columnManager;
me.visibleColumnManager = headerCtCfg.visibleColumnManager;
}

else {
if (Ext.isArray(headerCtCfg)) {
headerCtCfg = {
items: headerCtCfg
};
}
Ext.apply(headerCtCfg, {
grid: me,
forceFit: me.forceFit,
sortable: me.sortableColumns,
enableColumnMove: me.enableColumnMove,
enableColumnResize: me.enableColumnResize,
columnLines: me.columnLines,
sealed: me.sealedColumns
});

if (Ext.isDefined(me.enableColumnHide)) {
headerCtCfg.enableColumnHide = me.enableColumnHide;
}
me.headerCt = new Ext.grid.header.Container(headerCtCfg);
}
}


me.columns = columns = me.headerCt.getGridColumns();

me.scrollTask = new Ext.util.DelayedTask(me.syncHorizontalScroll, me);

me.cls = (me.cls || '') + (' ' + me.extraBaseCls);


delete me.autoScroll;

me.bufferedRenderer = bufferedRenderer = me.plugins && Ext.Array.findBy(me.plugins, function(p) {
return p.isBufferedRenderer;
});

mitchellsimoens
29 May 2014, 6:20 AM
Yes, me.bufferedRenderer will be the plugin if it finds one. Other section of code in question would be


// If we're in a reconfigure (we already have a BufferedRenderer which is bound to our old store),
// rebind the BufferedRenderer
if (bufferedRenderer) {
if (bufferedRenderer.store) {
bufferedRenderer.bindStore(store);
}
}
// Create a BufferedRenderer as a plugin if we have not already configured with one.
else {
bufferedRenderer = {
xclass: 'Ext.grid.plugin.BufferedRenderer'
};
Ext.copyTo(bufferedRenderer, me, 'variableRowHeight,numFromEdge,trailingBufferZone,leadingBufferZone,scrollToLoadBuffer');
me.bufferedRenderer = bufferedRenderer = me.addPlugin(bufferedRenderer);
}

mankz
29 May 2014, 7:00 AM
Please open a regular locked grid sample in latest nightly:


Ext.ComponentQuery.query('[bufferedRenderer]')

4 hits (2 grids, 2 grid views)

evant
29 May 2014, 7:09 AM
It will default to being on, but it will be turn-offable.

mankz
29 May 2014, 7:13 AM
Thanks for clarifying, this was my suspicion. Another item that would be great to see in the upgrade docs if not already there.