0

当我点击一个元素时,我有一个列表,我使用我的 NavigationView 推送新视图。

如何将所选元素传递给视图?

这是我的方法:

onListItemTap: function(dataview, index, target, record, e, eOpts) {
    dataview.up('navigationview').push({
        xtype: 'step3',
        title: record.data.titel
    });
}
4

1 回答 1

0

试试这个

onListItemTap: function(dataview, index, target, record, e, eOpts) {
    dataview.up('navigationview').push({
        xtype: 'step3',
        title: record.getData().titel,
        data : record.getData()
    });
}

如果你有这样的 step3 视图,你可以tpl像下面显示的那样访问里面的数据

Ext.define('MyApp.view.Step3', {
    extend: 'Ext.Container',
    xtype: 'step3',    
    config: {
        tpl: '<tpl for="."><h3>{titel}</h3><h5>{some other field in the record}</h5></tpl>'
    }
});

您还可以使用访问 Step3 视图中的数据this.data

于 2013-07-27T16:03:29.637 回答