Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the zTree tree plug-in

Shulou Source: shulou.com Published: 2022-06-03 09:21:46 11月16日 Update

This article will explain in detail how to use the zTree tree plug-in. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

ZTree is a multi-functional "tree plug-in" that relies on jQuery. Excellent performance, flexible configuration and the combination of multiple functions are the greatest advantages of zTree. ZTree is open source and free software (MIT license). If you are interested in zTree or are willing to fund the continued development of zTree, you can donate.

How's zTree?

ZTreev3.0 divides the core code by function, and unwanted code does not have to be loaded.

Using delayed loading technology, tens of thousands of nodes can be loaded easily, even under IE6.

Compatible with IE, FireFox, Chrome, Opera, Safari and other browsers

Support for JSON data

Support for static and Ajax asynchronous loading of node data

Support for arbitrary skin replacement / custom icons (depending on css)

Support for extremely flexible checkbox or radio selection

Provide multiple event response callbacks

Flexible editing (add / delete / change / check) function, you can drag and drop nodes at will, and you can also drag and drop multiple nodes

Multiple Tree instances can be generated at the same time in one page

Simple parameter configuration to achieve flexible functions

The simplest tree-- standard JSON data

How to realize zTree

[file path: core/standardData.html]

Parent Node 1-expand

Parent Node 11-collapse

Parent Node 12-collapse

Parent node 13-no child node

Parent Node 2-collapse

Parent node 3-no child node

1. Setting configuration information description

Normal use, no parameters that must be set

For display-related content, please refer to the configuration information in setting.view in the API documentation.

For name, children, title and other attribute definition changes, please refer to the configuration information in setting.data.key in the API documentation.

2. TreeNode node data description

Standard JSON data needs to be nested to represent the parent-child inclusion relationship of a node

For example:

Varnodes= [

{name: "parent Node 1", children: [

{name: "Child Node 1"}

{name: "Child Node 2"}

]}

On "how to use the zTree tree plug-in" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Tags: Nodes functions data configuration support plug-ins information articles references code content parameters multiple documentation more standard good excellent practical ordinary Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Technology MySQL Redmi Apple