日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

Extjs4 TreePanel實(shí)例

 旭龍 2013-01-22
隨著Extjs4第五預(yù)覽版的發(fā)布,更多的實(shí)例被放了出來(lái),本文介紹Extjs4 TreePanel的使用。此實(shí)例來(lái)自Extjs官方網(wǎng)站,此實(shí)例并沒(méi)有限制樹節(jié)點(diǎn)的拖放,例子中使用了TreeStore 和 AjaxProxy

隨著Extjs4第五預(yù)覽版的發(fā)布,更多的實(shí)例被放了出來(lái),本文介紹Extjs4 TreePanel的使用。此實(shí)例來(lái)自Extjs官方網(wǎng)站,此實(shí)例并沒(méi)有限制樹節(jié)點(diǎn)的拖放,例子中使用了TreeStore 和 AjaxProxy

HTML代碼:

 
  1. <div id="tree-div" style="width:250px;border:1px solid #c3daf9;"></div>

JS代碼:

 
  1. Ext.require([
  2.     'Ext.tree.*',
  3.     'Ext.data.*'
  4. ]);
  5. Ext.onReady(function() {    
  6.     var store = new Ext.data.TreeStore({
  7.         proxy: {
  8.             type: 'ajax',
  9.             url: 'get-nodes.php'
  10.         },
  11.         root: {
  12.             text: 'Ext JS',
  13.             id: 'src',
  14.             expanded: true
  15.         },
  16.         sorters: [{
  17.             property: 'leaf',
  18.             direction: 'ASC'
  19.         }, {
  20.             property: 'fileName',
  21.             direction: 'ASC'
  22.         }]
  23.     });
  24.     
  25.     var tree = new Ext.tree.TreePanel({
  26.         //autoScroll: true,
  27.         //enableDD: true,
  28.         //containerScroll: true,
  29.         animate: true,
  30.         border: false,
  31.         store: store,
  32.         viewConfig: {plugins: [{ptype: 'treeviewdd'}]},
  33.         renderTo: 'tree-div',
  34.         height: 300
  35.     });
  36. });

例子中返回的數(shù)據(jù)為JSON格式,要求服務(wù)端可以返回類似如下的數(shù)據(jù):

 
  1. [{"text":"layout","id":"src\/layout","cls":"folder"},{"text":"ComponentQuery.js","id":"src\/ComponentQuery.js","leaf":true,"cls":"file"},{"text":"draw","id":"src\/draw","cls":"folder"}]

 實(shí)例鏈接:dev./deploy/ext-4.0-pr5/examples/tree/reorder.html

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多