Sencha 商店的每个功能 console.log 不起作用

Sencha store's each function the console.log not work

我想显示记录,但是当我测试它以在控制台上使用 record.get('') 显示数据时,它不起作用。即使我点击静态代码 console.log('some thing')。它也无法在我的控制台上显示。

我控制器中的代码:

它在//-------这里

附近
Ext.define('ylp2p.controller.addtab',{
extend: 'Ext.app.Controller',

config: {
    refs: {
        myTabPanel: '.makemoney #tabfirst',
    },
    control: {
        myTabPanel: {
            activate: 'onActivateTabPanel',
            activeitemchange: 'onActiveItemChangeTabPanel'
        }
    }
},
launch: function(){
    var products = Ext.getStore('productstore');

    products.filterBy(function(record, id){
       return record.get('loanname') === 'xixi22';
    });
},

onActivateTabPanel: function(newActiveItem, viewport, oldActiveItem, eOpts) {
    //test
    console.log('hello the activatetabpanel is fire!');
    //end test success
    var tabs = Ext.getStore('loanliststore');
    tabs.each(function(record) {
        console.log('hello come on');//---------------------here it is
        newActiveItem.add({
            title: record.get('loanname')
        });
        console.log('');
    });
},

onActiveItemChangeTabPanel: function(cmp, value, oldValue, eOpts) {
    console.log('hello this is the activechangepanel is fire!');  
    var products = value.getStore();

    products.clearFilter(true);
    products.filterBy(function(record, id) {
        return record.get('loanname') === value.getTitle();
    });
}

});

检查 tabs.getCount() 如果它大于 0 那么它应该工作。如果不是,则表示您的商店中没有填充数据。