PDA

View Full Version : How to extend 'Ext.grid.feature.Summary'?



rulon
3 Feb 2014, 12:14 AM
my code:



Ext.define('Mytest', {
extend: 'Ext.grid.feature.Summary',
alias: 'feature.my'
});

Ext.define('MyGrid', {
extend: 'Ext.grid.Panel',
title: 'title',
store: myStore,
renderTo: Ext.getBody(),

features: [{
ftype: 'my' //'summary' works as expected
}],


columns: [
{
dataIndex: 'id',
text: 'id',
summaryRenderer: function() {return 'test str'}
},
{dataIndex: 'name', text: 'name'},
{
dataIndex: 'value',
text: 'value',
summaryType: 'sum'
}
]
});

Ext.create('MyGrid');




grid empty,
firebug show "TypeError: this.getNodeContainer(...) is null"
at ext-4.2.1.883/ext-all-debug-w-comments.js (line 149003)



// Note that these may be wrapping rows which *contain* rows which map to records

collectNodes: function(targetEl) {

line 149003 this.all.fill(this.getNodeContainer().childNodes, this.all.startIndex);

},




var my = Ext.create('Mytest');
...
features: [my], //same result

subj?
tnx.

5 Feb 2014, 7:31 AM
i'm looking into this. But... you should NEVER :) ever ever ever put renderTo in a prototype for a class.

rulon
6 Feb 2014, 1:03 AM
Prent class working as expected: ftype: 'summary'