gpt4 book ai didi

javascript - 选项卡式工具栏中的 Sencha Touch 列表组件

转载 作者:行者123 更新时间:2023-11-28 10:17:25 26 4
gpt4 key购买 nike

我正在使用 Sencha 触摸框架和列表项组件。我现在只用了大约两周的时间,我不知道如何让“onItemDisclosure”打开“detailPanel”。我试图遵循这个例子:http://vimeo.com/19245335 。我已将我的代码粘贴在下面。很感谢任何形式的帮助。

    GoW3Guide.views.detailPanel = Ext.extend(Ext.Panel, {
id: 'detailpanel',
tpl: 'Hello, {firstName}!',
dockedItems: [
{
xtype: 'toolbar',
items: [{
text: 'back',
ui: 'back',
handler: function() {
GoW3Guide.Viewport.setActiveItem('disclosurelist', {type:'slide', direction:'right'});
}
}]
}
]
});

Ext.reg('detailPanel', GoW3Guide.views.detailPanel);


GoW3Guide.views.listPanel = Ext.extend(Ext.List, {
id: 'disclosurelist',
store: GoW3Guide.ListStore,
itemTpl: '<div class="contact">{firstName} {lastName}</div>',
grouped: true,
onItemDisclosure: function(record, btn, index) {
GoW3Guide.views.detailPanel.update(record.data);
GoW3Guide.views.Guidescard.setActiveItem('detailpanel');
}
});

Ext.reg('listPanel', GoW3Guide.views.listPanel);



GoW3Guide.views.Guidescard = Ext.extend(Ext.Panel, {
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide',
initComponent: function() {
Ext.apply(this, {
items: [GoW3Guide.views.listPanel, GoW3Guide.views.detailPanel]
});
GoW3Guide.views.Guidescard.superclass.initComponent.apply(this, arguments);
}
});
Ext.reg('guidescard', GoW3Guide.views.Guidescard);

最佳答案

您遇到任何 JavaScript 错误吗?

根据文档,setActiveItem 需要一个组件实例、一个数字(卡片索引)或一个配置对象,例如{xtype:'detailPanel'}

如果您想激活新的详细信息面板,请尝试

GoW3Guide.views.Guidescard.setActiveItem({xtype:'detailpanel'});

GoW3Guide.views.Guidescard.setActiveItem(new GoW3Guide.views.detailPanel());

关于javascript - 选项卡式工具栏中的 Sencha Touch 列表组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6287679/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com