Home arrow JavaScript arrow Adding Elements to a Tree with TreeView jQuery

Adding Elements to a Tree with TreeView jQuery

When it comes to building hierarchical menus that will be used as part of web-based navigational interfaces, one of the best solutions available today is a powerful jQuery plug-in called TreeView. This package comes with a number of handy options that allow you to create collapsible trees very quickly by using only a few simple nested HTML lists. This is the conclusion to a six-part series that uses numerous code samples to show you how to master the main features provided by the TreeView library.

  1. Adding Elements to a Tree with TreeView jQuery
  2. Review: persisting hierarchical menus with TreeView's persist option
  3. Adding elements to an existing tree with the add option
  4. Appending multiple sub links with the add option
By: Alejandro Gervasio
Rating: starstarstarstarstar / 11
May 13, 2009

print this article



Naturally, if you've read the previous installment of this series, it's quite possible that you already have a clear idea of how to utilize the great variety of options offered by this plug-in to create truly dynamic hierarchical trees. In that specific article, I explained how to use the "persist" parameter to easily save the state of a given tree across several HTTP requests. 

In reality, the "persist" option takes two possible values. The first one, called "location," allows you to maintain the settings of the tree via the "href" attributes of the hyperlinks that comprise it, while the second one, identified as "cookie," obviously saves the tree's state by using some cookies. 

However, it's worth mentioning that the "TreeView" plug-in offers an additional feature, named "add," that deserves a close analysis. It can be employed to dynamically add elements to a selected tree. Therefore, in this last chapter of the series I'm going to discuss how to work with it, thus finishing this introductory overview to this powerful jQuery plug-in. 

Ready to tackle the final episode of this educational journey? Then let's get going! 

>>> More JavaScript Articles          >>> More By Alejandro Gervasio

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Javascript for Beginners: An Introduction
- Introduction to JavaScript
- Adding Elements to a Tree with TreeView jQue...
- Using the Persist Argument in a TreeView jQu...
- Using Unique and Toggle in a TreeView jQuery...
- Using Event Delegation for Mouseover Events ...
- Using the Animate Option in a Treeview jQuer...
- Using HTML Lists with Event Delegation in Ja...
- Opened and Closed Branches on a TreeView jQu...
- Mouseover Events and Event Delegation in Jav...
- Creating a TreeView JQuery Hierarchical Navi...
- Event Delegation in JavaScript
- A Look at the New YUI Carousel Control
- Working with Draggable Elements and Transpar...
- Displaying Pinned Handles with Resizable Con...

Developer Shed Affiliates


Dev Shed Tutorial Topics: