MzTreeView应用
来源:互联网 发布:网络贷款哪个最容易 编辑:程序博客网 时间:2024/06/14 05:38
<!-- Json 循环列出树形菜单 注意点:tree.nodes[]中键不可加引号 -->
<script type="text/javascript">
var tree = new MzTreeView("tree");
tree.icons["property"] = "property.gif";
tree.icons["css"] = "collection.gif";
tree.icons["event"] = "collection.gif";
tree.icons["book"] = "book.gif";
tree.iconsExpand["book"] = "bookopen.gif";
tree.setIconPath("/images/treeview/"); //展开时对应的图片的存放路径
tree.nodes["0_1"] = "text:世界;url:/Contract/index";
tree.nodes["1_2"] = "text:中国;url:/Contract/index";
tree.nodes["1_3"] = "text:美国;url:/Contract/index";
tree.nodes["2_5"] = "text:北京;url:/Contract/index";
tree.nodes["2_6"] = "text:天津;url:/Contract/index";
tree.nodes["2_7"] = "text:上海;url:/Contract/index";
tree.nodes["2_8"] = "text:河北;url:/Contract/index";
tree.nodes["3_9"] = "text:洛杉矶;url:/Contract/index";
tree.nodes["3_10"] = "text:华盛顿;url:/Contract/index";
tree.nodes["5_11"] = "text:海淀;url:/Contract/index";
tree.nodes["5_12"] = "text:朝阳;url:/Contract/index";
tree.nodes["8_13"] = "text:石家庄;url:/Contract/index";
tree.nodes["8_14"] = "text:邯郸;url:/Contract/index";
//var treeList = <?php echo $tree; ?>;
//for(var key in treeList){
// tree.nodes[treeList[key].concate.parent_id + "_" + treeList[key].concate.id] = "text:" + treeList[key].concate.caption + ";url:http://www.baidu.com;target:_blank";
//}
document.write(tree.toString());
<script type="text/javascript">
var tree = new MzTreeView("tree");
tree.icons["property"] = "property.gif";
tree.icons["css"] = "collection.gif";
tree.icons["event"] = "collection.gif";
tree.icons["book"] = "book.gif";
tree.iconsExpand["book"] = "bookopen.gif";
tree.setIconPath("/images/treeview/"); //展开时对应的图片的存放路径
tree.nodes["0_1"] = "text:世界;url:/Contract/index";
tree.nodes["1_2"] = "text:中国;url:/Contract/index";
tree.nodes["1_3"] = "text:美国;url:/Contract/index";
tree.nodes["2_5"] = "text:北京;url:/Contract/index";
tree.nodes["2_6"] = "text:天津;url:/Contract/index";
tree.nodes["2_7"] = "text:上海;url:/Contract/index";
tree.nodes["2_8"] = "text:河北;url:/Contract/index";
tree.nodes["3_9"] = "text:洛杉矶;url:/Contract/index";
tree.nodes["3_10"] = "text:华盛顿;url:/Contract/index";
tree.nodes["5_11"] = "text:海淀;url:/Contract/index";
tree.nodes["5_12"] = "text:朝阳;url:/Contract/index";
tree.nodes["8_13"] = "text:石家庄;url:/Contract/index";
tree.nodes["8_14"] = "text:邯郸;url:/Contract/index";
//var treeList = <?php echo $tree; ?>;
//for(var key in treeList){
// tree.nodes[treeList[key].concate.parent_id + "_" + treeList[key].concate.id] = "text:" + treeList[key].concate.caption + ";url:http://www.baidu.com;target:_blank";
//}
document.write(tree.toString());
</script>
注意:注意:当用循环Json时,需要注意到tree.nodes[""]中的""是不可用的,否则可能会显示不了!当写数据时,可以这样写:tree.nodes["0_1"] = "text:AAA;url:bbb";但当循环时,例:tree.nodes["'" + treeList[key].concate.parent_id + "_" + treeList[key].concate.id + "'"] = "text:" + treeList[key].concate.caption + ";url:http://www.baidu.com;target:_blank";这种不可取。"'"不能写。
最后效果:如下图
- MzTreeView应用
- MzTreeView
- MZTreeView
- MzTreeView
- jsp中mztreeview的应用实例
- jsp中mztreeview的应用实例
- MzTreeView 1.0
- MzTreeView 1.0
- MzTreeView 1.0 开发文档
- MzTreeView 1.0 开发文档
- MzTreeView 1.0开发文档
- MzTreeView树型菜单
- MzTreeView 1.0 开发文档
- MzTreeView 1.0 开发文档
- MzTreeView 控件使用
- MzTreeView 2.0 后台生成示例
- MzTreeView(梅花雪)完全攻略
- 使用MzTreeView构造异步树
- “压缩感知” 之 “Hello World”
- dfgallery 2.0 安装配置
- ACE日志系统之本机日志系统的多文件实现
- 后缀数组
- OpenCV中Mat与IplImage和CvMat类型之间的相互转换
- MzTreeView应用
- HDU1702
- QT图形视图框架(待完成)
- openOffice+pdf2swf类百度文库):pdf转swf(Linux,window)
- hdu 2236 无题II
- adb shell dumpsys
- 处理ListView拖动会变黑的问题
- JSON的使用
- extend jQuery easyUI datagrid methods