Error when you use "features" config in its own class
jacobweber opened this issue · comments
Jacob Weber commented
In your mvc example, I moved the grid in Main.js into its own class, MainGrid.js:
Ext.define('Grid.view.MainGrid', {
extend: 'Ext.ux.touch.grid.View',
xtype : 'mainGrid',
config: {
tabBarPosition: 'bottom',
title : 'Grid',
columns : [
{
header : 'Text',
dataIndex : 'text',
width : '90%'
},
{
header : 'Amount',
dataIndex : 'amount',
width : '10%'
}
]
}
});
and used it in Main.js like this:
{
xtype : 'mainGrid',
store : 'Grid'
}
This works. But then I tried adding a sorting feature to MainGrid.js:
features: [
{
ftype : 'Ext.ux.touch.grid.feature.Sorter',
launchFn : 'initialize'
}
],
This gives me an error in Feature.js line 38:
TypeError: 'undefined' is not a function (evaluating 'me._features.add(feature)')
It seems to be using _features, which is also used by the Sencha config system when you use "features" as a config name.
Mitchell Simoens commented
Just pushed an update to fix this. Also added to the MVC example to have the grid it's own class.
Jacob Weber commented
I think you forgot one, in line 49 of Feature.js: features = me._features;
Mitchell Simoens commented
True enough. Fixed!