Yii 1.1: dynatree

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

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

Requirements

Yii 1.1 or abobe

Usage

You can call widget in view files like following.

<?php $this->widget('ext.dynatree.DynaTree',array(
    'attribute'=>CHtml::activeName($model,'categories'),
    'data'=>Category::model()->getCategoryTree('tree'),
    'selection'=>$model->categoryIds,
)); ?>

Resources

Total 9 comments

#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

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

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

This extension saves a lot of time..

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

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