我无法将数据从控制器传递到 Sencha Touch 2.4 中的视图

I cannot pass data from controller to a view in Sencha Touch 2.4

我尝试了一些不同的方法,但无法将数据从控制器传递到视图(传递到容器内的组件)。

这里是我的观点ServisDetail.js:

Ext.define('Asistan.view.ServisDetail', {
    extend: 'Ext.Container',
    xtype: 'servisDetail',
    config: {
        layout: 'fit',
        items : [
            {
                xclass : 'Asistan.view.ServisToolbar'
            },
            {
                // "data: {}" is needed to work. I try to pass data from controller to here
                xtype: 'component',
                tpl: Ext.create('Ext.XTemplate','{URUN_CIHAZ_ADI} jkjk')
            }
        ]
    }
});

这是我的控制器 Servis.js,我 认为 认为它应该可以工作。但它不传递数据:

Ext.define('Asistan.controller.Servis', {
    extend: 'Ext.app.Controller',
    config: {
        refs: {
            servis: 'servisNavigationView servisContainer list',
        },
        control: {
            servis: {
                itemdoubletap: 'showServis'
            }
        }
    },
    showServis: function(item, index, e, eOpts) {
        this.servis = Ext.widget('servisDetail');
        this.servis.config.items[1].data = eOpts.data; // <- Here! It doesn't work. console.log shows that the data is there but in the browser the data doesn't show up.
        console.log(this.servis.config.items[1].data); // I can see my data here, right before the push
        item.up('servisNavigationView').push(this.servis);
    }
});

我错过了什么?

尝试使用

showServis: function(item, index, e, eOpts) {
    this.servis = Ext.widget('servisDetail');
    this.servis.setData(eOpts.data);  // setData applies the data to the container template.
    item.up('servisNavigationView').push(this.servis);
}

带有 tpl 的项目应该有 id

{
    id: 'itemWithTpl', // <- here
    xtype: 'component',
    tpl: Ext.create('Ext.XTemplate','{URUN_CIHAZ_ADI} jkjk')
}

控制器:

showServis: function(item, index, target, record, e, eOpts) {
    this.servis = Ext.widget('servisDetail');
    item.up('servisNavigationView').push(this.servis);
    Ext.getCmp('itemWithTpl').setData(record.data); // <- here
}