最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

入門(mén)基礎(chǔ)學(xué)習(xí) ExtJS筆記(一)

 更新時(shí)間:2010年11月11日 14:52:04   作者:  
這段時(shí)間手中項(xiàng)目已經(jīng)完成,空閑時(shí)間較多。開(kāi)始了學(xué)習(xí)ExtJs之旅。
大致看了幾天的書(shū)籍 查閱了API。頭腦里也記不下多少,學(xué)習(xí)還是動(dòng)手比較好。就試著開(kāi)始寫(xiě)寫(xiě):
首先:開(kāi)始搭個(gè) 界面框架.
第一步當(dāng)然是引用ExtJs的相關(guān)文件:
<link rel="Stylesheet" href="resources/css/ext-all.css" />
<script type="text/javascript" src="ext-base.js"></script>
<script type="text/javascript" src="ext-all-debug.js"></script>
定義一個(gè)Ext.Viewport:
在items的屬性里設(shè)置:
頭部:
復(fù)制代碼 代碼如下:

      {
region: 'north',
html: '<h1 class="x-panel-header">CRM管理系統(tǒng)</h1>',
autoHeight: false,
border: false,
margins: '0 0 5 0'
}

左側(cè)的管理樹(shù):
復(fù)制代碼 代碼如下:

{
region: 'west',
collapsible: true,
title: '管理菜單',
xtype: 'treepanel',
width: 200,
autoScroll: true,
split: true,
loader: new Ext.tree.TreeLoader(),
root: new Ext.tree.AsyncTreeNode({
expanded: true,
children: [
{
text: '系統(tǒng)設(shè)置',
leaf: true,
url: 'userlist'
},
{
text: '用戶管理',
leaf: false,
children: [
{
id: 'userlist', text: '用戶列表', leaf: true
}
]
},
{ id: 'news',
text: '新聞資訊',
leaf: true
}]
}),
rootVisible: false,
listeners: {
click: function (node, event) {
//Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' + node.attributes.text + '"');
event.stopEvent();
var n = contentPanel.getComponent(node.id);
// alert(n);
if (!n && node.leaf == true) { // //判斷是否已經(jīng)打開(kāi)該面板
n = contentPanel.add({
'id': node.id,
'title': node.text,
closable: true,
autoLoad: {
url: node.id + '.html',
scripts: true
} // 通過(guò)autoLoad屬性載入目標(biāo)頁(yè),如果要用到腳本,必須加上scripts屬性
});
}
contentPanel.setActiveTab(n);
}
}
}

右邊具體功能面板區(qū):
復(fù)制代碼 代碼如下:

new Ext.TabPanel({
region: 'center',
enableTabScroll: true,
activeTab: 0,
items: [{
id: 'homePage',
title: '首頁(yè)',
autoScroll: true,
html: '<div style="position:absolute;color:#ff0000;top:40%;left:40%;">主頁(yè)</div>'
}]
});

這樣一個(gè)簡(jiǎn)單的界面就搭出來(lái)了。界面如下:

相關(guān)文章

最新評(píng)論

江油市| 竹山县| 车致| 石渠县| 阿勒泰市| 确山县| 百色市| 甘泉县| 鄂托克旗| 黄山市| 萍乡市| 鹤峰县| 荆门市| 清丰县| 宝应县| 太仆寺旗| 朝阳区| 台北县| 米林县| 郴州市| 繁昌县| 扎兰屯市| 鄄城县| 环江| 尉犁县| 黄冈市| 中阳县| 南川市| 河曲县| 宜宾市| 阜平县| 开远市| 松原市| 安阳市| 浪卡子县| 台州市| 潼关县| 嘉兴市| 敦煌市| 宁武县| 盱眙县|