Yii Framework Forum: Problem With Renderpartial + Registerscript - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problem With Renderpartial + Registerscript Rate Topic: -----

#1 User is offline   KillCloud 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 02-November 12
  • Location:São Paulo, Brazil

Posted 06 February 2013 - 11:08 AM

I'm working with one controller and one view. In my controller i am using a renderPartial function to render my "search" view. In my "search" view i have a respective script (using registerScript function) that works for search data with ajax. But the javascript code does not appear in the source code (browser). If i create another view and call the function renderPartial inside this view and point to the "search" view, the javascript code appears. Someone know why i can't see my javascript code (and the function doens't work) when i'm using the function renderPartial inside the controller and the registerScript in the view?
0

#2 User is offline   seenivasan 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 620
  • Joined: 17-June 12
  • Location:Chennai,TamilNadu,India.

Posted 06 February 2013 - 11:22 AM

Dear Friend

Did you call the function in the following way?

$this->renderPartial("yourView",$data,false,true);//the last parameter "true" ensures that view is rendered along with scripts.

0

#3 User is offline   Azy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 156
  • Joined: 16-May 12

Posted 06 February 2013 - 11:45 AM

View Postseenivasan, on 06 February 2013 - 11:22 AM, said:

Dear Friend

Did you call the function in the following way?

$this->renderPartial("yourView",$data,false,true);//the last parameter "true" ensures that view is rendered along with scripts.



Yes, The last param, should be true which is by default a false. Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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