mitchellsimoens / Ext.ux.touch.grid

Grid components for Sencha Touch 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when you use "features" config in its own class

jacobweber opened this issue · comments

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.

Just pushed an update to fix this. Also added to the MVC example to have the grid it's own class.

2611735

I think you forgot one, in line 49 of Feature.js: features = me._features;

True enough. Fixed!