惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
G
Google Developers Blog
B
Blog
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志
The Register - Security
The Register - Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
The Cloudflare Blog
The Hacker News
The Hacker News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
雷峰网
雷峰网
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
A
About on SuperTechFans
量子位
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
H
Help Net Security
Help Net Security
Help Net Security
P
Palo Alto Networks Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Troy Hunt's Blog
W
WeLiveSecurity
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
Know Your Adversary
Know Your Adversary
Apple Machine Learning Research
Apple Machine Learning Research
Scott Helme
Scott Helme
N
News | PayPal Newsroom
AWS News Blog
AWS News Blog
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
腾讯CDC
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
TaoSecurity Blog
TaoSecurity Blog
GbyAI
GbyAI
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
D
Docker

博客园 - 无声雨

远程桌面不能复制粘贴到本地的解决办法 操作文件或者文件夹做硬连接 使用Google Map获取地址坐标 SharePoint2010 安装时报“未能启动数据库服务 MSSQL$Sharepoint"解决办法 解决OracleDBConsoleorcl服务无法启动问题[转帖] oracle10g dbconsole 重建步骤(转帖) 做个记号,VS2008中选择默认环境 SQLServer2005SP2安装时提示KB921896错误 Asp.Net2.0中TreeView使用javascript客户端实现选择节点联动的脚本 WindowsXp系统时services.exe占用内存和CPU资源的问题 EXT中GRID自动适应宽与高 Grid使用动态数据源的问题 IE6下PNG图片对象以及其作为背景透明的处理 关于韩文等文字存储乱码的问题 EXT中的语言包 使用ASP生成条形码(转) IE地址栏javascript代码(转) 设置双网卡同时访问内外网 BAT文件的妙用(转)
Ext中tree的研究
无声雨 · 2007-10-19 · via 博客园 - 无声雨

新建一棵树

var Tree = Ext.tree;    
var tree1 = new Tree.TreePanel({
    el:'tree
-content-div',
    border:
false,
    autoScroll:
true,
    animate:
true,
    enableDD:
true,
    containerScroll: 
true,
    rootVisible:
false,
  loader: 
new Tree.TreeLoader({
        dataUrl:'RemoteHandlers
/GetContentMenu.aspx'
     }
)
}
);                            
tree1.on('click', 
function (node){    
if(node.isLeaf()){
   Ext.get('center
-iframe').dom.src = node.attributes.hrefTarget; }
else{
   node.toggle(); }
  
}
);
            
//tree1.on('beforeload', function (node){ 
//
tree1.loader.dataUrl = 'RemoteHandlers/GetSystemMenu.aspx';
//
});
            
var root1 = new Tree.AsyncTreeNode({
    text: '内容管理',
    draggable:
false,
    id:'source1'
}
);
                    
tree1.setRootNode(root1);
tree1.render();
root1.expand();

rootVisible:指是否显示根节点

#2008-04-21#

TreeLoader其实就是一个类似JSON的数据
关于JSON的生成,其实网上有很多现成的类可以使用,大家可以到http://www.json.org/去看看,里面有针对不同的语言的生成方式等!
但是要注意的是JSON数据的字段名称的单引号或者双引号不能要,如:

strs.Append("["); 
foreach (ModuleType mt in ilModuleType) 

strs.Append(
"{"); 
strs.Append(
"id:'" + mt.Id + "',"); 
strs.Append(
"text:'" + mt.Name + "',"); 
strs.Append(
"leaf:false"); 
AddSubNodes(mt, s, strs); //添加子节点
strs.Append(
"},"); 
}
 
tmp 
= strs.ToString(); 
tmp 
= tmp.Replace("}{""},{"); 
tmp 
= (tmp.Substring(tmp.Length - 1== ","? tmp.Substring(0,tmp.Length-1)+"]" : ""

注意:上面的ModuleType 和 ilModuleType都是我的对象或者变量