qowoeo7538
qowoeo7538
2015-08-25 12:04

easyui和ztree一起使用的时候怎么使单个节点单击主内容DIV发生跳转.

  • easyui
  • 张挺
  • javascript

这是我的javascript代码.哪
里不对的吗?

     function zTreeOnClick(event, treeId, treeNode) {
            if ($("#tt").tabs("exists", treeNode.name)) {
                $("#tt").tabs("select", treeNode.name);
            } else {
                $("#tt")
                        .tabs(
                                "add",
                                {
                                    title : treeNode.name,
                                    closable : true,
                                    content : "<iframe src='"
                                            + treeNode.url
                                            + "' title='"
                                            + treeNode.name
                                            + "' height='100%' width='100%' frameborder='0px' ></iframe>",
                                })
            }
        };
        var setting = {
            data : {
                simpleData : {
                    enable : true
                },
                key : {
                    url : "xUrl"
                }
            },
            callback : {
                onClick : zTreeOnClick
            }
        };
    var zNodes = [
                {
                    id : 1,
                    pId : 0,
                    name : "基础数据录入",
                    open : false,
                    iconOpen : "${proPath}/JQuery-zTree-v3.4/css/zTreeStyle/img/diy/1_open.png",
                    iconClose : "${proPath}/JQuery-zTree-v3.4/css/zTreeStyle/img/diy/1_close.png"
                },
                {
                    id : 11,
                    pId : 1,
                    name : "管理",
                    icon : "${proPath}/JQuery-zTree-v3.4/css/zTreeStyle/img/diy/2.png",
                    url : "${proPath}/base/goURL/supp/suppList.action",
                } ];

        $(document).ready(function() {
            $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        });
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答