国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

Extjs學(xué)習(xí)筆記之七 布局

2024-05-06 14:11:54
字體:
供稿:網(wǎng)友
Extjs Layout Browser .

Extjs3.1.0 版本支持17種,下面挑一些重要的簡(jiǎn)要的說明一下,要看效果,去上面給的鏈接,不再貼圖了。給Panel設(shè)置Layout的方法是一樣的,就是設(shè)置Panel的Layout配置項(xiàng)。
1. AbsoluteLayout
可以通過Panel內(nèi)部組件的決定位置來布局。通過x,y來指定。

示例用法:
代碼如下:
new Ext.Panel({
layout: 'absolute',
title: 'AbsuluteLayout',
renderTo: document.body,
frame: true,
defaultType: 'textfield',
width: 400,
height:250,
items: [{
x: 0, y: 5,
xtype: 'label',
text: 'Send To:'
},
{
x: 60, y: 0,
name: 'to'
}, {
x: 0, y: 35,
xtype: 'label',
text: 'Subject:'
}, {
x: 60, y: 30,
name: 'subject'
},
{
x: 0, y: 60,
xtype: 'textarea',
name: 'msg'
}]
});

2.AccordionLayout
Accordion的意思是手風(fēng)琴,顧名思義,這種布局可以向手風(fēng)琴那樣,有的組件張開,有的閉合。這種效果作為側(cè)邊欄比較有用。

示例用法:
代碼如下:
new Ext.Panel({
title: 'Accordion Layout',
layout: 'accordion',
renderTo: document.body,
defaults: { // applied to each contained panel
bodyStyle: 'padding:15px'
},
layoutConfig: {
// layout-specific configs go here

titleCollapse: true,
animate: true,
activeOnTop: false
},
items: [{
title: 'Panel 1',
html: '<p>Panel content!</p>'
}, {
title: 'Panel 2',
html: '<p>Panel content!</p>'
}, {
title: 'Panel 3',
html: '<p>Panel content!</p>'
}]
});
});

3. AnchorLayout
這種Layout非常有用,尤其是在布局含有GridView這一類控件的頁面的時(shí)候,AnchorLayout實(shí)際上類似于Winform的form默認(rèn)的布局方式,不過它僅僅可以固定某一個(gè)組件距離頁面邊框(右邊框和底邊框)的距離(絕對(duì)的像素或者相對(duì)比例)。 通過anchor屬性設(shè)置,anchor屬性的設(shè)置API文檔上解釋的十分清楚,就直接摘抄過來了:

anchor : String

This configuation option is to be applied to child items of a container managed by this layout (ie. configured withlayout:'anchor').

This value is what tells the layout how an item should be anchored to the container. items added to an AnchorLayout accept an anchoring-specific config property of anchor which is a string containing two values: the horizontal anchor value and the vertical anchor value (for example, '100% 50%'). The following types of anchor values are supported:

Percentage : Any value between 1 and 100, expressed as a percentage.
The first anchor is the percentage width that the item should take up within the container, and the second is the percentage height. For example:

// two values specified
anchor: '100% 50%' // render item complete width of the container and
// 1/2 height of the container
// one value specified

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 襄樊市| 宜良县| 盐源县| 连州市| 宁化县| 蒙自县| 家居| 罗山县| 马尔康县| 元氏县| 宁河县| 眉山市| 云阳县| 青神县| 额尔古纳市| 兴仁县| 隆安县| 通河县| 大余县| 定襄县| 聂荣县| 磐安县| 宜阳县| 同德县| 青阳县| 洪湖市| 北碚区| 旬邑县| 庄河市| 屯门区| 临夏市| 建平县| 铁岭市| 宜君县| 青岛市| 腾冲县| 宝坻区| 同仁县| 曲松县| 南澳县| 滨州市|