The treeTable plugin allows you to display a tree in a table, i.e. a directory structure or a nested list. Each branch in this tree can be collapsed and expanded, just like in a file explorer in most modern operating systems.
protected/extensionsSee the following code example:
$this->widget('ext.treetable.JTreeTable',array( 'id'=>'treeTable', 'primaryColumn'=>'id', 'parentColumn'=>'parent_id', 'columns'=>array( 'id'=>array( 'label'=>'Id', 'headerHtmlOptions'=>array('width'=>80), 'htmlOptions'=>array('align'=>'center'), ), 'name'=>'Name', ), 'items'=>array( array('id'=>1,'parent_id'=>0,'name'=>'test 1'), array('id'=>2,'parent_id'=>1,'name'=>'test 1\'s children 1'), ), 'options'=>array( 'initialState'=>'expanded', ), ));
Total 4 comments
how can i add control buttons to delete, view posts in table?
The display of the options is depended from the order of the ids inside the database. please fix that!
Also could you please correct the usage of tables inside the view? use divs instead. Much more flexible IMHO
Muy buena extensión, es muy útil para crear árboles binarios.
Nice treetable. Do yourself. :}
Leave a comment
Please login to leave your comment.