View Full Version : Buffered Renderer problem

13 Aug 2014, 2:48 AM
Hello Folks,

i am working with the buffered renderer, i have created a grid view which contains a row expander plugin.
i added a row expander plugin configuration as follow:

plugins: {
ptype: 'bufferedrenderer',
numFromEdge : 8,
trailingBufferZone: 20,
leadingBufferZone: 20,
variableRowHeight : true

the store loads on start 100 record, and the user can request more records by special button.
the problem while scrolling in the grid i get the following error:

TypeError: elements[target] is undefined
targetTop = me.bodyTop + elements[target].offsetTop;

when i checked the values with a debugger there was one of the elements item is undefined.

any idea what is this error and how i can fix it?

Thanks in advance
Jamil Isayyed

13 Aug 2014, 12:48 PM
What version of Ext4 are you using?

Also, what do you mean more records by a special button? The idea of the buffering to is to load a new set as needed.

13 Aug 2014, 11:26 PM
I am using extjs 4.2.2, and in my application i want to allow the user to load data set if needed by load more button. and the effect of the bufferrenderer is to minimize the number of rendered elements and rows in the Dom document.

what i found with debugging that in one point with the x templates for rendering grid, especially the row renderer tpl the code loose the view ID and don't know where to render the row.

values.view is null!

var fm=Ext.util.Format,ts=Object.prototype.toString;
$= function (out,values,parent,xindex,xcount,xkey) {
var c0=values, a0=Array.isArray(c0), p0=parent, n0=xcount, i0=xindex, k0, v;
out.push('<tr data-boundView="')
if ((v=values.view.id) != null) out.push(v+'')

The stack to get to this point of code is as follow:

$(Code Above)114 (line 5)
Ext.XTemplate#applyOut()ext-dev.js (line 25080)
Ext.view.Table#renderRow()Table....9783727 (line 983)
Ext.view.Table#renderRows()Table....9783727 (line 879)
$()41 (line 22)
Ext.XTemplate#applyOut()ext-dev.js (line 25080)
Ext.view.Table#tplApplyOut()Table....9783727 (line 687)
Ext.view.Table#tplApplyOut()Table....9783727 (line 687)
$()40 (line 4)
Ext.XTemplate#applyOut()ext-dev.js (line 25080)
Ext.XTemplate#apply()ext-dev.js (line 25063)
Ext.Template#overwrite()ext-dev.js (line 23946)
Ext.view.Table#bufferRender()Table....9783727 (line 759)
Ext.view.NodeCache#scroll()NodeCa...9784776 (line 343)
Ext.grid.plugin.BufferedRenderer#onRangeFetched()Buffer...9782442 (line 589)
Ext.grid.plugin.BufferedRenderer#renderRange()Buffer...9782442 (line 526)
Ext.grid.plugin.BufferedRenderer#handleViewScroll()Buffer...9782442 (line 500)
Ext.grid.plugin.BufferedRenderer#onViewScroll()Buffer...9782442 (line 451)
anonymous()anonymous (line 5)
wrap()ext-dev.js (line 17558)

Then i get this error:
TypeError: Argument 1 of Node.appendChild is not an object.

Then this error on scroll
TypeError: elements[target] is undefined
targetTop = me.bodyTop + elements[target].offsetTop;