Click here to Skip to main content
15,881,861 members
Articles / Web Development / HTML
Article

Tree List View Built with XSLT and DHTML

Rate me:
Please Sign up or sign in to vote.
3.71/5 (11 votes)
24 Feb 20022 min read 97.8K   1.5K   31   5
A tree view and list view hybrid built with XSLT and DHTML

Sample Image

Introduction

I am a Visual C++ guy. So why I am talking about XSLT and DHTML now? Sometimes, I am tired of writing C++ codes. Think about how much code you need to write when you want to sink events in ATL, how much code you need to write when you build or manipulate collections in ATL. It's too much and boring. But with DHTML, there are tons of building blocks you can use. I don't need to build a grid control, I don't need to call GDI functions. And it has flexible layout, various appearances.

This idea comes from two reasons: one is I always wanted to build a tree list view by myself, the other is I am an XSLT learner now. ADOData.xml is the XML file generated by ADO when you persist a recordset as XML. ADOData2Hier.xsl is the XSLT file for transforming XML file into HTML file and does the work of grouping data into hierarchies. You can find the grouping method in XSLT from different sources, there is an article about it in Code Project too. Source codes are short, so just see source code for details.

The platform I mentioned is the platform on which I built this. I think it should be OK if you have IE5+ and XSLT (not XSL). I never used netscape because our company and I only use IE.

The codes are just to show the idea. There are many possible improvements.

  • declare global parameters in XSLT file, in the script call addParameter to decide which fields you want to do the grouping and summation (or other aggregation).
  • any number of levels of grouping, also you can declare global parameters, but this may require more work to do.
  • there is an article "fun with tables" in MSDN, you can integrate code from that article to do some column reordering, column choosing, etc.
  • use HTML, CSS features to make the appearance more colorful.

If somebody makes improvements, don't forget to send me a copy.

http://www.visualplant.com

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionExpand Collapse dont work in Firefox/Netscape Pin
disci15-Feb-07 22:59
disci15-Feb-07 22:59 
GeneralThanks for sharing! Pin
DBuckner16-Apr-03 3:57
DBuckner16-Apr-03 3:57 
Questionwhy use concat in a key? Pin
VirtualLife30-Mar-03 6:17
VirtualLife30-Mar-03 6:17 
Generalyour download has no content!! Pin
Anonymous6-Sep-02 13:40
Anonymous6-Sep-02 13:40 
GeneralCode Pin
AFShin Dehghani25-Mar-02 5:52
AFShin Dehghani25-Mar-02 5:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.