View Full Version : Problem writing my own grid feature

22 Feb 2012, 6:30 AM
As a starting point to understanding and possibly writing my own grid feature, I started w/ the Ext.grid.feature.GroupingSummary. I copied the code into my own js file and modified the define/namespace and alias.

alias: 'feature.myappgroupingsummary',

In my grid code I do this:

//this.features = Ext.create('Ext.grid.feature.GroupingSummary',{ // THIS LINE WORKS
this.features = Ext.create('Myapp.feature.GroupingSummary',{ // THIS DOESN'T WORK
groupHeaderTpl: '{name}'

If I substitute in the creation of my feature, I get the following error:
me.summaryGroups[index-1] is undefined
name = me.summaryGroups[index-1].name,

in the case of the error, index equals 2, but the there is only one summary group. I started digging through the template code but got complicated pretty quickly.

Other than the namespace/alias change, not sure why this wouldn't work as the feature code didn't change.


22 Feb 2012, 7:37 AM
Your alias is wrong... you have this:

alias: 'feature:'myappgroupingsummary'

Where it should be:

alias: 'feature.myappgroupingsummary'

22 Feb 2012, 7:46 AM
Thanks for looking at this. Actually, that was a typo on my part in the forum post. Code is as you described.


Tim Toady
22 Feb 2012, 9:08 AM

also a typo? You shouldn't have that right paren there.

22 Feb 2012, 10:03 AM
arg! yes, sorry. (Based on my configuration, this had to be retyped vs. copy/paste)