链接到 Sencha Touch 中新面板的按钮
请原谅我的天真。我正在尝试将工具栏上的按钮链接到新卡,而不是选项卡面板。新卡将具有与家庭不同的面板元素我已经观看了所有视频图并阅读了这里的几篇文章,但不知何故从未完全设法对其进行排序。
new Ext.Application({
name: 'Demo App',
launch: function() {
this.viewport = new Ext.TabPanel({
fullscreen: true,
id: 'mainPanel',
html: 'Welcome',
cls: 'homescreen',
dockedItems: [{
xtype: 'toolbar',
ui: 'light',
title: 'Home',
items: [
{text: 'Option1', ui: 'action', flex: 1},
{xtype: 'spacer', },
{text: 'Option2', ui: 'action',flex: 1 }
]
}]
});
}
});
pardon my naivety here. I'm trying to make buttons on a ToolBar link to a new card as opposed to TabPanels. The new card will have different panel elements than the home I've watched all the video tuts and read several articles on here, yet somehow never quite manage to get it sorted.
new Ext.Application({
name: 'Demo App',
launch: function() {
this.viewport = new Ext.TabPanel({
fullscreen: true,
id: 'mainPanel',
html: 'Welcome',
cls: 'homescreen',
dockedItems: [{
xtype: 'toolbar',
ui: 'light',
title: 'Home',
items: [
{text: 'Option1', ui: 'action', flex: 1},
{xtype: 'spacer', },
{text: 'Option2', ui: 'action',flex: 1 }
]
}]
});
}
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这并不是选项卡面板的真正意义。它应该将卡片加载到主面板中并让您在它们之间移动。您可以通过拦截卡开关并渲染新的单独面板来加载新的全屏面板(可能有自己的选项卡面板或其他元素),如下所示:
然后您必须以某种方式关闭该面板(可能是关闭按钮),以便用户可以返回到原始选项卡面板。不过,您最好保持选项卡面板不变,然后将新卡添加到选项卡面板内的面板中。
希望这能回答您的问题。
That's not really the point of a tab panel. It's supposed to load cards into the main panel and let you move between them. You could load a new fullscreen panel (which could have it's own tab panel or other elements) by intercepting the card switch and rendering your new separate panel like so:
You would then have to close that panel somehow (a close button probably) so the user could return to the original tab panel. Though you are better off leaving the tab panel as is and add new cards to panels within the tab panel.
Hope this answers your question.