我在表单中有一个按钮,在单击按钮事件时,卡片布局页面向后移动到上一页。
{
xtype: 'panel',
id: 'promotionPanel',
layout: {
type: 'card',
animation: {
type: 'slide'
}
},
items: [
{
xtype: 'panel',
items: [{
xtype: 'toolbar',
docked: 'top',
ui: 'light',
title: 'Promotions',
items: [{
xtype: 'button',
html: '<img src="../images/back_arrow.png">',
ui: 'action',
id: 'BtnBack',
itemId: 'BtnBack',
handler: function () {
Ext.getCmp('promotionPanel').setActiveItem('homePanel');
}
}, {
xtype: 'button',
docked: 'right',
html: '<img src="../images/home.png">',
ui: 'action',
id: 'BtnHome',
itemId: 'BtnHome',
handler: function () {
}
},
]
},
{
xtype: 'image',
height: 480,
width: 320,
html: '<img src="../images/promotion.png" >',
itemId: 'myimage',
}
]
}]
}
在这个处理函数中,我完成了从promotionPanel
跳转到homePanel
的代码。但它不会来,两页被覆盖。我该如何解决这个问题?
最佳答案
您可以为该页面上的按钮提供 Id,然后您可以在下面使用监听器提供推送到下一页或您想要的任何页面的功能。
如果您需要一些示例代码,请告诉我,我可以帮助您。
关于javascript - 如何在sencha2 的cardlayout 中从page3 跳转到page1?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9436787/