Because of several requests about the slow load time of my former treeview control (when table records exceed 2000)
I have developed this simple ajax treeview solution to take advantage of its Load on Demand feature so that no mater how large a dataset is, the treeview will always load quickly.
This solution is aimed at those who want to dynamically load their treeview items from a database with many records.
The code for this treeview solution is quite different because instead of using
<UL/> element, it uses the
<TABLE/> element because some users
wanted to be able to click the
+/- signs to open/close the treeview and add a link to all tree nodes.
The source code for this solution cotains the following files:
treeview.asp:The treeview source file which implements the public function
GetChildNodes(intParentId) which returns a transformed XML string of the child nodes. Other private helper functions include:
GetDbXml, GetDbString & LoadXmlDoc
treeview.xsl - the stylesheet to transform the XML.
site.mdb - the sample database
process_request.asp - the file that is loaded by the Ajax function.