我正在使用 sencha touch o'really 示例。是具有关联会话和发言人的会议。想象一下,我有一个会话列表,当点击该列表时,视图将更改为会话详细信息。
我有这样的看法:
Ext.define('MyApp.view.session.Detail', {
extend: 'Ext.Container',
xtype: 'session',
config: {
layout: 'vbox',
title: '',
items: [
{
flex: 1,
layout: 'fit',
scrollable: 'vertical',
xtype: 'sessionInfo'
},
{
flex: 2,
xtype: 'speakers',
store: 'SessionSpeakers',
items: [
{
xtype: 'listitemheader',
cls: 'dark',
html: 'Speakers'
}
]
},
{
flex: 1,
xtype: 'button',
text: "Decline Button" ,
handler: function () {
/*HERE I WANT TO PUT SOME DATA FROM THE SESSION OBJECT. FOR EXAMPLE */
alert({title});
alert({start_date});
alert({location});
}
}
]
}
}); 因此,我想将 {title} {start_date} {location} 替换为当前会话的相应值。
顺便说一句,在控制器中我有这个:
onSessionTap: function(list, idx, el, record) {
var speakerStore = Ext.getStore('SessionSpeakers'),
speakerIds = record.get('speakerIds');
speakerStore.clearFilter();
speakerStore.filterBy(function(speaker) {
return Ext.Array.contains(speakerIds, speaker.get('id'));
});
if (!this.session) {
this.session = Ext.widget('session');
}
this.session.setTitle(record.get('title'));
this.getSessionContainer().push(this.session);
this.getSessionInfo().setRecord(record);
},
谢谢!!