ExtJs Card 布局之向导

上一步,下一步的类向导,这里用card布局。
Ext.onReady(function () {
this.firstPanel = new Ext.Panel({
frame: true,
title: '第一个面板',
html: '这是第一个面板'

});
this.secondPanel = new Ext.Panel({
frame: true,
title: '第二个面板',
html: '这是第二个面板'

});
var i = 0;
function cardHandler(direction) {
if (direction == -1) {
i--;
if (i < 0) {
i = 0;
}
}
if (direction == 1) {
i++;
if (i > 1) {
i = 1;
return false;
}
}
var btnNext = Ext.getCmp("move-next");
var btnPrev = Ext.getCmp("move-prev");
var btnSave = Ext.getCmp("move-save");
if (i == 0) {
btnSave.hide();
btnNext.enable();
btnPrev.disable();

}
if (i == 1) {
btnSave.show();
btnNext.disable();
btnPrev.enable();
}
this.cardPanel.getLayout().setActiveItem(i);
};
//CARD总面板
this.cardPanel = new Ext.Panel({
frame: true,
title: 'card 面板',
renderTo: document.body,
height: 400,
width: 400,
layout: 'card',
activeItem: 0,
bbar: ['->', {
id: 'move-prev',
text: '上一步',
handler: cardHandler.createDelegate(this, [-1])
},
{
id: 'move-save',
text: '保存',
hidden: true,
handler: function () {
alert("保存");
}
},
{
id: 'move-next',
text: '下一步',
handler: cardHandler.createDelegate(this, [1])
}],
items: [this.firstPanel, this.secondPanel]
});
});
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值