私は動的に入力しているリストを持っています。新しいビューを作成し、アイテムのボタンタップを介してその場で(タブビューで)表示したいのですが、正しく行っているとは思いません。これを正しく実装するにはどうすればよいですか?
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: 'MyApp',
launch: function () {
Ext.Viewport.add({
xclass: 'MyApp.view.Main'
});
}
});
Ext.define('MyApp.view.Main', {
extend: 'Ext.TabPanel',
config: {
fullscreen: true,
tabBarPosition: 'bottom',
defaults: {
styleHtmlContent: true
},
items: [
{xtype:'schedulecard'},
{xtype: 'settingscard'}
]
}
});
var scheduleItems = Ext.create('Ext.data.Store', {
storeId: 'schedulestore',
fields: ['name', 'day'],
sorters: 'day',
grouper: {
groupFn: function (record) {
return record.get('day')[0];
}
},
data: [
{ name: 'Cowper', day: 'Monday' },
{ name: 'Everett', day: 'Monday' },
{ name: 'University', day: 'Tuesday' },
{ name: 'Forest', day: 'Tuesday' }
]
}); // create()
Ext.define('MyApp.view.Schedule', {
extend: 'Ext.List',
xtype: 'schedulecard',
grouped: true,
config: {
title: 'Schedule',
iconCls: 'settings',
store: 'schedulestore',
itemTpl: '<span style="font-weight:bold;">{name}</span> {day}',
listeners: {
itemtap: function (list, index, item, evt) {
**//In here is where I wish to to display new View**
}
},
items: [{
xtype: 'titlebar',
docked: 'top',
title: 'MyApp'
}]
}
});
scheduleItems.add({ name: 'test', day: 'Wednesday' });
scheduleItems.add({ name: 'test', day: 'Wednesday' });
scheduleItems.add({ name: 'test', day: 'Wednesday' });
scheduleItems.add({ name: 'test', day: 'Wednesday' });
scheduleItems.add({ name: 'test', day: 'Thursday' });
scheduleItems.add({ name: 'test', day: 'Thursday' });
scheduleItems.add({ name: 'test', day: 'Thursday' });
scheduleItems.add({ name: 'test', day: 'Friday' });
scheduleItems.add({ name: 'test', day: 'Friday' });
Ext.define('MyApp.view.Settings', {
extend: 'Ext.Panel',
xtype: 'settingscard',
config: {
title: 'Settings',
iconCls: 'settings',
html: 'Settings new',
items: [{
xtype: 'titlebar',
docked: 'top',
title: 'MyApp',
items: [
{
align: 'left',
text: 'Back'
},
{
align: 'right',
text: 'refresh'
}
]
}]
}
});