Active Panel equivalent


(Drigolin) #1

I'm looking how to handle in Yii somenthing similar to ActivePanel in Prado. I need to handle an update of a div inside the page during and ajax exent. Badically I would like to render only a part of view. I don't know how to do it in that framework.

If it's possible maybe I need to create a specific widget "ActivePanel"…

I don't know.


(Notzippy) #2

There is an CHtml->Ajax() method, I believe passing this method the result of CControl->renderPartial() may do the trick…

But I may be very incorrect :D

nz


(Qiang Xue) #3

If you read jQuery docs, you will find that updating a div via AJAX is very easy.

CHtml::ajax is a wrapper of jQuery's AJAX support.


(Drigolin) #4

I found how to update a div… I need to find how to execute js on client side like part of this process. Maybe I need only to send a

<script language="javacript">

myFunc();

</script>

Instead of pure HTML like I'm doing now.


(Qiang Xue) #5

Using CHtml, this can be done simply as follows:



echo CHtml::script(


    CHtml::ajax(array(


        'url'=>'/path/to/yourAction',


        'update'=>'#divID',


    ))


);


Of course, you can also use jQuery directly.