为什么函数没有在Extjs中调用

时间:2016-08-28 11:19:52

标签: javascript node.js extjs sencha-touch

Ext.define('iTell.view.MarketView', {
    extend: 'Ext.Container',
    xtype: 'marketview',

    config: {
        scrollable: false,
        layout: 'fit',
        items: [
            {
                xtype: 'toolbar',
                title: Malls,
                docked: 'top',
                items: [
                    {
                        xtype: 'button',
                        ui: 'back',
                        text: 'Back',
                        cls: 'backBtnCls',
                        iconMask: true,
                        id: 'exitAppBtn',
                        handler: function () {
                            this.up('marketview').fireEvent('exitApp', this);
                        }
                    },
                    {
                        xtype: 'spacer'
                    },
                ]
            },
            {
                xtype: 'list',
                loadingText: "",
                scrollable: true,
                scrollToTopOnRefresh: false,
                selectedCls: 'item_selected_bg_style',
                store: 'MarketStore',
            },
        ]
    },
    loadData: function () {
        test();
    }

    test(){
        alert("this is the method to been called");
    }
});

为什么没有调用测试方法?

1 个答案:

答案 0 :(得分:0)

添加this指针

this->test();