Yii Framework Forum: Active Panel equivalent - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Active Panel equivalent Rate Topic: -----

#1 User is offline   drigolin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 08-October 08

Posted 08 October 2008 - 07:52 AM

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.
0

#2 User is offline   notzippy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 06-October 08

Posted 08 October 2008 - 09:00 AM

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
0

#3 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,856
  • Joined: 04-October 08
  • Location:DC, USA

Posted 08 October 2008 - 09:18 AM

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.

0

#4 User is offline   drigolin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 08-October 08

Posted 08 October 2008 - 12:35 PM

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.
0

#5 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,856
  • Joined: 04-October 08
  • Location:DC, USA

Posted 08 October 2008 - 12:44 PM

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users