Ztree automatically click on the first node (reprint)

Source: Internet
Author: User

        varsetting ={view: {dblclickexpand:true,//Double-click ExpandShowlayer:false, Selectedmulti:false,//whether to allow multiple selectionsShowicon:showiconfortree//Show node Small icon}, Data: {simpledata: {enable:true, IdKey:"id", PIdKey:"PId", Rootpid:"0"}}, callback: {Beforeclick:beforeclick, OnClick        : OnClick}}; //loads the tree structure information list for the current project        functionLoadstructureinfotreejson (ProjectID) {$.ajax ({type:"POST", DataType:"JSON", URL:".. /tools/structuremodel.ashx ", data: {act:"Loadmodeltreebyprojectid", Pid:projectid}, Success:function(data) {if(Data.length = = 0) {                    } Else{$.fn.ztree.init ($ ("#tree"), setting, data); varZtree = $.fn.ztree.getztreeobj ("tree");//Get Ztree Object                        varnode = ztree.getnodebyparam (' id ', 1);//get the point with ID 1Ztree.selectnode (node);//Select PointZTree.setting.callback.onClick (NULL, zTree.setting.treeId, node);//Invoke Event}}, Error:function() {alert ("There is a problem loading the tree structure!" ");        }            }); }        functionShowiconfortree (Treeid, TreeNode) {returnTreenode.isparent;//If the parent node displays small icons};

Original link: http://blog.csdn.net/a15937822658/article/details/17759995

Ztree automatically click on the first node (reprint)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.