More information about this topic
Reset database
 | 
CTreeview
  • Grampa
    • Father
      • me
      • big sis
      • little brother
    • Uncle
      • Ben
      • Sally
    • Aunt

protected/modules/UiModule/views/ui_other/tree_view.php


$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
        ),
));

protected/modules/UiModule/controllers/Ui_otherController.php

	public function actionTreeView() {
		$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->render('tree_view', array('dataTree'=>$dataTree));
	}
References
Fork me on GitHub