"Jstree" asynchronously loads JSON node data 004

Source: Internet
Author: User

$ ("#jqTree"). Jstree ({//This example is only part of the function that remains to be optimized for the place"Json_data" : {                "Ajax" : {                    ' type ': ' Get ',                    //"Cache": false,"url": "URL of request JSON",                    "Data":function(n) {//parameters passed to the background                        return {                             "OrgID": N.attr? N.ATTR ("id"). Replace ("Node_", ""): 0//The OrgID here is the name of the parameter I passed to the backstage.                        }; },                    "Success":function(data) {//The parameters returned in the background, due to the parameters returned in the background Jstree parse,                        vardataarray=NewArray ();//so I'm going to spell the array of objects that Jstree can parse and return directly$.each (Data.orglist,function(i,item) {varjsonobj={"Data": {"title": Item.name},"attr": {"id": Item.id}}; if(item.type!= "Student") {//student identification is a leaf nodeJsonobj.state= "Closed";//This is the value that identifies whether this node has child nodes.} dataarray.push (Jsonobj);                        }); returnDataArray; }                }            },            "Themes": {"theme": "Default", "dots":false, "Icons":false },            "Plugins": ["Themes", "Json_data", "checkbox", "CRRM"]}). Delegate ("A", "click",function(Event, data) {Event.preventdefault ();});//this sentence is changed in the node a tag of the default execution Jstree on the demo has
View Code

"Jstree" asynchronously loads JSON node data 004

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.