I don’t quite get the meaning of your code. But usually to display CTreeView I use code like this :
$dataTree = array(
array(
'text'=>'Grampa', //must using 'text' key to show the text
'children'=>array( //using 'children' key to indicate there are children
array(
'text'=>'Father',
'children'=>array(
array('text'=>'me'),
array('text'=>'big sis'),
array('text'=>'little brother'),
)
),
array(
'text'=>'Uncle',
'children'=>array(
array('text'=>'Ben'),
array('text'=>'Sally'),
)
),
array(
'text'=>'Aunt',
)
)
)
);
$this->widget('CTreeView',array(
'data'=>$dataTree,
'animated'=>'fast', //quick animation
'collapsed'=>'false',//remember must giving quote for boolean value in here
'htmlOptions'=>array(
'class'=>'treeview-red',//there are some classes that ready to use
),
));
Smitty, please use code tag (second button to the right) when pasting code examples, so it will be more readable to others.
And about your problem. junxiong pasted you a working example (from Yii Playground, if I’m not mistaken) and it is also working for me. If your own code does not work (you don’t see any Tree) please use the one provided and modify it to your needs. Or double check your code, where you probably made a mistake.
Can you be a little more specific, what do you want to achieve? CTreeView class doesn’t have link property. You must give us more details, so we can try to help you.
I have the update image wrapped in an html <a href> in front of my displayed item. when I click on the image it executes the update link. when I click on the + or the dislpayed item it expands.