Yii 1.1: dynatree

Wrapper class for jQuery Dynatree extension also handles with setting selected items and form submit.

Wrapper class for jQuery Dynatree extension also handles with setting selected items and attaches selected items to the form in hidden fields.


Yii 1.1 or abobe


You can call widget in view files like following.

<?php $this->widget('ext.dynatree.DynaTree',array(
)); ?>


Total 10 comments

#18990 report it
Vinod Agarwal at 2015/02/19 05:48am
Search in Dynaa tree

Hi I wrote a script to enable search in dynatree. Let me know if it contains error or can be improved.

var tree_id=".$tree_id.";
if(typeof tree_id == 'object')
var text=$(this).val();
if(text.length < 4) 
    var keys=new Array();
        function(node) {
            var li = node.li;
            var title=node.data.title;
            if((title.toLowerCase()).indexOf(text.toLowerCase()) !== -1) 
                if(keys.indexOf(node.data.key) === -1)
<p><input class="search" id="search-tree" placeholder="Search Categories here..." autocomplete="off" /></p>
#15148 report it
broker at 2013/10/11 03:50pm
Re: An error?

Yes, you are right. This is a bug. I updated the extension.

#15143 report it
RandomWhiteTrash at 2013/10/11 02:29am
An error?

Am I wrong or is there an error?

Line 73 sets $id, which is then never used (instead $this->id is in use, but there is no declatarion for $id in the class).

I couldnt make it work with passing the htmlOptions['id'], but once I added $id to class declaration and replaced $id with $this->id it started to work. Please correct or explain where was I lost...

#13499 report it
broker at 2013/06/01 02:02pm
Re: Ajax Button

Hi StuartMc, You can edit DynaTree.php line 99-103. Instead of regular submit, you can make an ajax call on submit event. But you to serialize selected items.

#13490 report it
StuartMc at 2013/05/31 11:54am
Ajax Button

Please could you tell me how to attach this to the post parameters on an ajax button?

#11581 report it
broker at 2013/01/21 05:24pm
demo application

I uploaded demo application. It includes all related models and controller codes. Sample data is located under protected/data folder(testdrive.sql).

#11481 report it
broker at 2013/01/16 03:29am
demo application/sample data

Hi zvik2004, Thank you for your advice. I will submit a demo application and sample data to download.

#11477 report it
zvik2004 at 2013/01/15 07:19pm
Need an example

Thanks for this extension, really great!
It would be helpful to have an example of the 'data' and 'selection' format.

#10934 report it
Manoj M at 2012/12/05 12:58am

This extension saves a lot of time..

#10706 report it
Cherif at 2012/11/17 05:01am

You know what I havent time to make an extension for this, for my project I used vanilla JS with hidden field to post data from forms (can you imagine the whole work :p) but now I will test that and you will have my feedback.

Leave a comment

Please to leave your comment.

Create extension