DHTML + XML + ASP + CSS = tree directory

xiaoxiao2021-03-06  17

Tree directory display program

Problem Description:

A self-associated data table often occurs in our project. If we look at the overall, the entire table is presented as a tree data structure (for complex situations, it may become a picture). When we show this table, when we do not use a good expression, it will be very awkward. To this end, we develop such a tree structure. In the previous version, we used the recursive algorithm to achieve, and we found that there is no longer competent for the database that has thousands of records, so in the new algorithm version, we Using XML technology, dynamic discovery data to solve the embarrassment of a large amount of data from the server, while also spread, if the table data structure is presented as a picture, it will enter the dead cycle error.

Actual ideas:

1. Only the root and secondary nodes are displayed, the root and secondary nodes are one level.

2, click on a node, if its child node area object does not exist, establish an object, and download data update data, display all subpatals.

3. Each node has the same function after the establishment, such as checking the child node, showing hidden child nodes, etc.

4, DHTML XML ASP CSS simultaneously

Technical Difficulties:

1. Coal code issues when using XMLHTTP interface:

Because the default encoding scheme is not Chinese, the default encoding scheme is not interpreted in the XMLHTTP of the client page, it will be garbled in the default scheme. To do this, we join the following code definition coding scheme in the ASP page of the Server end:

Response.charset = "GB2312"

Response.contentType = "text / html"

2, how to keep the previous version of the style (formal manager form) on the interface:

In the previous version, all the page content is unique. In the control, recursion is used, and the interface is relatively friendly. At that time, the mechanism in this version changed, and the content has multiple synthesis.

Key questions, how IMG, span objects are determined

After payment, on the interface, the interface of this version is difficult to be the same as the first interface, so it can only be retained, but in general, the new interface can also meet the needs.

Because it is not good here, you can only post source code:

--- xtree.html -------------------------------------------------------------------------------------------------------------------------------------------------- -----------------------