Haven't been to update the blog for a long time. Today I'm going to present myself with a Web tree widget that I've been writing two years ago.
As programmers, we all know that it is not easy to implement a tree presentation page on the Web, we can search the Internet for the implementation of trees
Principles and methods and examples.
The following are a few
1.javascript script, the disadvantage of more than N, the display of static simple tree can also be used
This way to take all the data at once, and then through a large number of scripts on the client to construct, the shortcomings are obvious, such as large amount of data;
Must construct a certain tree-shaped data beforehand, whether it is XML or array; The operation state cannot be preserved after refreshing the page;
The response speed of hundreds of thousands of object, and so on. Let alone operate the tree.
The 2.Applet type combines jtree trees. I didn't use it myself, I can do it in this way. But it should be more complicated, such as the intersection with the Web container
Mutual or JS script interaction.
3.ActiveX type of tree. I didn't use it, no comment, anyway, to register the DLL, the client impact is relatively large.
4. The tree generated by the server, this component is used in this way. Good and bad, please try: After their own comments.
This tree control overcomes the disadvantages of the above various types of tree artifacts, and expands itself to implement many new functions, which are easy to use, but
20来 Line code, do not need special code, and the same, do one, the next can copy the previous code to change.
Attach an effect chart:
The main features that are implemented are
. Automatically shows the tree structure data in the specified table of the database without human involvement. such as organization chart, commodity list, etc.
. Unlimited number of layers
. Refresh status can be preserved
. Displays the specified icon according to the node properties, such as the icon for the person is p.jpg, the departmental icon is u.jpg, etc.
. Implemented by configuration settings, without special code. such as what new node, delete node, set node icon, etc.
. can be used as
> Tree-Shape Display data
such as the organization structure tree
> Tree-type Single-selection data, tree-type multiple-selection data
such as selecting people or merchandise, etc.
. There are other features (extended by business requirements), such as setting a tree with only a leaf-level link, setting only select people, and so on
Visual Design Support