ajax - render parial

I try to update content with ajaxLink like in this example ( http://www.yiiframework.com/doc/cookbook/49/ ) but I create ajaxLink not in view but in controller. These links are created in ajax method ajaxFillTree and they are text proporties in CTreeView widget. Tree is created dynamically in ajaxFillTree. If I try to click in thats links there is no actions.

Method in ajaxFillTree:

public function actionAjaxFillTreeJednostki(){

                if (!Yii::app()->request->isAjaxRequest) {



        $parentId = 0;

        if (isset($_GET['root'])) {

            $parentId = (int) $_GET['root'];



        $children = Jednostki::model()->findAllByAttributes(array('rodzic'=>$parentId));



                $data[$i]['text'] = CHtml::ajaxLink(



                                                                array(  'update' => '#data',





                $maDzieci = Jednostki::model()->findByAttributes(array('rodzic'=>$children[$i]->id));











        echo CTreeView::saveDataAsJson($data);





Method ajaxUpdate

public function actionUpdateAjax()


        $data = array();

        $id = $_GET['id'];

        $data['info']='to jest ajax, id: '.$id;


        $data['dInformacje'] = Jednostki::model()->findByPk($id);


        $this->renderPartial('_ajaxContent', $data, false, true);




View wyswielt.php

<div id="data">

        <?php echo $this->renderPartial('_ajaxContent',array(






View _ajaxContent.php

<div id="informacje_glowne">

<?php echo $info;?>

<?php  echo "<br />".$dInformacje->nazwa?>

</div><!-- informacje_glowne -->

Where is a problem?

Hi I try to update CTreeView Nodes when insert new data in database …

can U help me how can i do that??