浏览 5390 次
锁定老帖子 主题:求助,EXT的Tree
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2007-04-24
<div id="main-ct" style="width:100%;height:100%;"></div> 脚本 Ext.onReady(function(){ var xt = Ext.tree; // turn on quick tips Ext.QuickTips.init(); var cview = Ext.DomHelper.append('main-ct', {cn:[{id:'main-tb'},{id:'cbody'}]} ); // create our layout var layout = new Ext.BorderLayout('main-ct', { center: { title:'Components', margins:{left:3,right:3,bottom:3,top:3} } }, 'main-ct'); layout.batchAdd({ center : { el: cview, autoScroll:true, fitToFrame:true, resizeEl:'cbody' } }); // the component tree var ctree = new xt.TreePanel('cbody', { animate:true, enableDD:true, containerScroll: true, lines:false, rootVisible:false }); var croot = new xt.AsyncTreeNode({ allowDrag:false, allowDrop:false, id:'croot', text:'Packages and Components', cls:'croot', loader:new Ext.tree.TreeLoader({ dataUrl:'/tmp1.json' }) }); ctree.setRootNode(croot); ctree.render(); croot.expand(); }); JSON文件 [{"text":"profil1@anonyme.ca", "id":"10\/1", "cls":"cmp", "leaf":false, "children":[{"text":"Favoris", "id":"10\/1\/favoris", "cls":"cmp", "leaf":false, "children":[{"text":"une Fiche", "id":"10\/1\/favoris\/idFiche", "cls":"cmp", "leaf":true, }, {"text":"un sous-dossier de Favoris", "id":"10\/1\/favoris\/sousDossier", "cls":"cmp", "leaf":false, "children":[{"text":"une Fiche", "id":"10\/1\/favoris\/idFiche", "cls":"cmp", "leaf":true}] }] }, {"text":"Poubelle", "id":"10\/1\/poubelle", "cls":"cmp", "allowDrop":true, "leaf":true} ] }] 我运行这个例子,在firefox下正常显示,而IE下却什么都不显示,看一下。谢谢了 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2007-04-24
js 代码
把 "leaf":true, 后面的逗号去掉 |
|
返回顶楼 | |