我正在尝试让我的测试项目正常运行,并为每个屏幕设置了各种视口js文件。我现在设法使用下面的代码将数据加载到屏幕上,但是我正在努力设置onItemDisclosure函数,以便它切换到详细视图,显示有关选择项的更多信息。
MobileApp.views.Settings_screen = Ext.extend(Ext.Panel, {
title: "Settings ",
iconCls: "settings",
fullscreen: true,
layout: 'card',
dockedItems: [{
xtype: "toolbar",
title: "Settings"
}],
initComponent: function() {
detailPanel = new Ext.Panel({
id: 'detailPanel',
tpl: 'Hello, World'
}),
this.list = new Ext.List({
id: 'indexlist',
store: MobileApp.listStore,
itemTpl: '<div class="contact">{firstName} {lastName}</div>',
grouped: false,
onItemDisclosure: function() {
MobileApp.views.setActiveItem('detailPanel');
}
});
this.items = [this.list];
MobileApp.views.Settings_screen.superclass.initComponent.apply(this, arguments);
}
});
Ext.reg('settings_screen', MobileApp.views.Settings_screen);
我试图在这里放一些代码来切换到detailPanel,但它出现了一个未定义的错误。
onItemDisclosure: function() {
MobileApp.views.setActiveItem('detailPanel');
}
谢谢Aaron
答案 0 :(得分:0)
您需要在Settings_screen的命名空间下定义此面板,如下所示:
this.detailPanel = new Ext.Panel({
id: 'detailPanel',
tpl: 'Hello, World'
}),
此外,您需要将detailPanel添加到Settings_screen的项目中,以便它成为它的一个项目。
this.items = [this.list, this.detailPanel];