SimpleTree not working (ajax)

Hi all,

I´ve installed SimpleTree extension and followed all the steps described in the usage section, but it doesn´t work at all. I allways get this error:

Undefined index: model

This is my ajaxcontroller (inside Site Controller):

public function actionSimpletree()


{


Yii::import('application.extensions.SimpleTreeWidget');    


    SimpleTreeWidget::performAjax();


}	

And this is in my view (inside simpletree.php):

$this->widget(‘application.extensions.SimpleTreeWidget’,array(

'model'=>'SimpleTree',


'ajaxUrl' => $this->createAbsoluteUrl('/site/simpletree'),

));

Please, anyone can see what´s wrong with this???

Thanks!

simpletree not working for me too … for me it is showing a revolving image with Loading.

I have ajaxcontroller

<?php

class AjaxController extends Controller

{

public function actionIndex()


{


	&#036;this-&gt;render('index');


}





// Uncomment the following methods and override them if needed


/*


public function filters()


{


	// return the filter configuration for this controller, e.g.:


	return array(


		'inlineFilterName',


		array(


			'class'=&gt;'path.to.FilterClass',


			'propertyName'=&gt;'propertyValue',


		),


	);


}





public function actions()


{


	// return external action classes, e.g.:


	return array(


		'action1'=&gt;'path.to.ActionClass',


		'action2'=&gt;array(


			'class'=&gt;'path.to.AnotherActionClass',


			'propertyName'=&gt;'propertyValue',


		),


	);


}


*/








public function actionsimpletree()


{


    Yii::import('application.extensions.SimpleTreeWidget');    


    SimpleTreeWidget::performAjax();


}

}

and i have a model class

Tree

<?php

/**

  • This is the model class for table "SampleDB.Tree".

  • The followings are the available columns in table ‘SampleDB.Tree’:

  • @property integer $id

  • @property integer $id_parent

  • @property string $tittle

  • @property integer $position

  • The followings are the available model relations:

  • @property Tree $idParent

  • @property Tree[] $trees

*/

class Tree extends CActiveRecord

{

/**


 * Returns the static model of the specified AR class.


 * @return Tree the static model class


 */


public static function model(&#036;className=__CLASS__)


{


	return parent::model(&#036;className);


}





/**


 * @return string the associated database table name


 */


public function tableName()


{


	return 'SampleDB.Tree';


}





/**


 * @return array validation rules for model attributes.


 */


public function rules()


{


	// NOTE: you should only define rules for those attributes that


	// will receive user inputs.


	return array(


		array('id', 'required'),


		//array('id, id_parent, position', 'numerical', 'integerOnly'=&gt;true),


		//array('tittle', 'length', 'max'=&gt;45),


		// The following rule is used by search().


		// Please remove those attributes that should not be searched.


		//array('id, id_parent, tittle, position', 'safe', 'on'=&gt;'search'),


		array('id', 'safe', 'on'=&gt;'search'),


	);


}





/**


 * @return array relational rules.


 */


public function relations()


{


	// NOTE: you may need to adjust the relation name and the related


	// class name for the relations automatically generated below.


	return array(


		'idParent' =&gt; array(self::BELONGS_TO, 'Tree', 'id_parent'),


		'trees' =&gt; array(self::HAS_MANY, 'Tree', 'id_parent'),


	);


}





/**


 * @return array customized attribute labels (name=&gt;label)


 */


public function attributeLabels()


{


	return array(


		'id' =&gt; 'ID',


		'id_parent' =&gt; 'Id Parent',


		'tittle' =&gt; 'Tittle',


		'position' =&gt; 'Position',


	);


}





/**


 * Retrieves a list of models based on the current search/filter conditions.


 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.


 */


public function search()


{


	// Warning: Please modify the following code to remove attributes that


	// should not be searched.





	&#036;criteria=new CDbCriteria;





	&#036;criteria-&gt;compare('id',&#036;this-&gt;id);


	//&#036;criteria-&gt;compare('id_parent',&#036;this-&gt;id_parent);


	//&#036;criteria-&gt;compare('tittle',&#036;this-&gt;tittle,true);


	//&#036;criteria-&gt;compare('position',&#036;this-&gt;position);





	return new CActiveDataProvider(get_class(&#036;this), array(


		'criteria'=&gt;&#036;criteria,


	));


}

}

And My view is

<?php

$this->breadcrumbs=array(

'Ajax',

);?>

<h1><?php echo $this->id . ‘/’ . $this->action->id; ?></h1>

<p>

You may change the content of this page by modifying


the file &lt;tt&gt;&lt;?php echo __FILE__; ?&gt;&lt;/tt&gt;.

<tt>

<?php

//$this->widget(‘application.extensions.SimpleTreeWidget’,array(

// ‘model’=>‘Tree’,

//));

$this->widget(‘application.extensions.SimpleTreeWidget’,array(

//'model'=&gt;Tree::model()-&gt;id,  //Folder::model()-&gt;findByPk(43),


'model'=&gt;'Tree',//::model()-&gt;findByPk(1),


'modelPropertyParentId' =&gt; 'parent_id',


//'modelPropertyName' =&gt; 'tittle',//'name',


//'modelPropertyId' =&gt; 'id',   


'modelPropertyPosition' =&gt; 'position',


'ajaxUrl' =&gt; &#036;this-&gt;createAbsoluteUrl('/ajax/simpletree'),


'onSelect'=&gt;'


    var id = data.inst.get_selected().attr(&quot;id&quot;).replace(&quot;node_&quot;,&quot;&quot;);


    &#036;(&quot;#contentBox&quot;).load(&quot;/ajax/getContent/id/&quot;+id);


'

));

?>

</tt>.

</p>