jQuery. treeView, Dynamic trees

The company that I work for asked me to develop a dynamic tree application, in which you could add, edit, and delete nodes. So after doing some research and a couple failed attempts using yahoo developer and dojo JavaScript tree libraries, I went with what I know (jQuery).

Let me say thanks to Jörn Zaefferer, for his jquery treeview plugin which gave me the framework for the working tree and Chris Domigan for his jquery contextMenu plugin which saved me from writing a right click popup menu with controls.

You can view and play around with my tree application here.

Keep in mind that this is just a javascript/jQuery demo of how the application works.
What I found that after every change I made to the tree, by adding a new node, I had to remove all attributes that make the tree a working application. You can find this code at the bottom of the function add().

	$('#'+ul).removeClass('treeview');
$('#'+ul+' li').removeAttr('class');
$('#'+ul+' div').remove();
$('#'+ul+' ul').removeAttr('style');
Immediately, after all tree attributes are removed, I had to rebuild the tree with the function maketree() and re-initialize the context menu on the span elements of the tree.

You can view and play around with my tree application here.
| | Comments (0) | TrackBacks (0)

Leave a comment

BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda,bmw bmw bmw Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota  
Volvo, Toyota, Volvo, Saab, Audi, Nissan Mercedes, Volvo, Nissan, Honda,Volvo Volvo Volvo Acura, Honda, Acura Forerunner, SUV, Volvo, Mercedes, Toyota
Volvo, Toyota, Volvo, Saab, Audi, Nissan Mercedes, Volvo, Nissan, Honda,Volvo Volvo Volvo Acura, Honda, Acura Forerunner, SUV, Volvo, Mercedes, Toyota


Chicago Blackhawks
Chicago Blackhawks
Stanley Cup
Stanley Cup
Pittsburgh Penguins
Pittsburgh Penguins
Boston Bruins
Boston Bruins
Fire & Flames
Fire & Flames








 


Categories

BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, Acura, Honda, Acura Forerunner,bmw bmw bmw SUV, BMW, Mercedes, Toyota