Ext 布局

[b][size=large]1、card layout.[/size][/b]

//a util function.
var navigate = function (panel, direction) {
var layout = panel.getLayout();
layout[direction]();
Ext.getCmp('move-prev').setDisabled(!layout.getPrev());
Ext.getCmp('move-next').setDisabled(!layout.getNext());
};

// card layout
Ext.create('Ext.panel.Panel', {
title: 'Example Wizard',
width: 300,
height: 200,
layout: 'card',
bodyStyle: 'padding:15px',
defaults: {
border: false
},
bbar: [{
id: 'move-prev',
text: 'Back',
handler: function (btn) {
navigate(btn.up("panel"), "prev");
},
disabled: true
},
'->',
{
id: 'move-next',
text: 'Next',
handler: function (btn) {
navigate(btn.up("panel"), "next");
}
}
],
items: [{
id: 'card-0',
html: '<h1>Welcome to the Wizard!</h1><p>Step 1 of 3</p>'
}, {
id: 'card-1',
html: '<p>Step 2 of 3</p>'
}, {
id: 'card-2',
html: '<h1>Congratulations!</h1><p>Step 3 of 3 - Complete</p>'
}],
renderTo: Ext.getBody()
});


[img]http://dl2.iteye.com/upload/attachment/0097/9390/c56d266d-6d8e-38b2-973c-b421dd3aff05.png[/img]

[b][size=large]2. vbox layout:[/size][/b]

Ext.create('Ext.Panel', {
width: 500,
height: 400,
title: "VBoxLayout Panel",
layout: {
type: 'vbox',
align: 'center'
},
renderTo: document.body,
items: [{
xtype: 'panel',
title: 'Inner Panel One',
width: 250,
flex: 2
},
{
xtype: 'panel',
title: 'Inner Panel Two',
width: 250,
flex: 7
},
{
xtype: 'panel',
title: 'Inner Panel Three',
width: '100%',
flex: 1
}]
});



[img]http://dl2.iteye.com/upload/attachment/0097/9392/8d2434e1-11ff-3d52-85e0-d7f01e62d079.png[/img]


转自:

http://www.cnblogs.com/sunjinpeng/archive/2011/12/16/2289833.html

查看更多(访问可能需要番羽墙软件):
http://nodebook.info/book/view?bid=539524d78a13c8206fbe9449


--
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值