CTreeView widget is looking and behaving strange

I'm working my way through Yii and found that the CTreeView is behaving a little strange

Setup: latest SVN Yii, Yiic created web application

I have added a new action to SiteController like this:



public function actionTest()


{


    $tdata =    array


                (


                    array


                    (


                        'text'            => 'Node 1',


                        'expanded'        => false,


                    ),


                    array


                    (


                        'text'            => 'Node 2',


                        'expanded'        => false,


                        'children'        =>    array


                                            (


                                                'text'            => 'Node 2.1',


                                            ),


                    ),


                );





    $this->render('test',array('tdata' => $tdata));


}


the view file looks like this:



<h1>Tree Test</h1>


<?php


$this->widget('CTreeView',array('data' => $tdata));


?>


Issues:

  1. The image for the first node looks like it's a 'between' 2 nodes image.

  2. The sub node is not displayed correctly

I hope that I'm doing something wrong, so please let me know what.

Br

Steen

Issue 2 is due to the fact that children should be an array of children - My mistake.

It looks fine using the yiic webapp. Maybe it's because of your CSS?

I use the CSS created by Yiic webapp.

Take a look at the picture I have attached (I have made a red square), then you will see that it looks like the 'tree' is not started correctly - No 'root'

That’s the expected behavior. Check this: http://jquery.bassis…/treeview/demo/