Yii Framework Forum: renderPartial, ajaxLink and fancybox problem - Yii Framework Forum

Jump to content

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

renderPartial, ajaxLink and fancybox problem Rate Topic: -----

#1 User is offline   Headshaker 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 21-January 11
  • Location:London

Posted 13 December 2011 - 08:15 AM

Hi there !

I've got problem with not working ajaxLink.

how it looks:

I'm using fancybox with ajax request to renderPrtial view which contains CHtml::ajaxLink but link doesn't work.

Without fancybox and renderPartial request is send normaly by ajaxLink.

controller:
public function actionKick()
 {
   if(isset($_POST['cn'])){
      echo $_POST['cn'];
   }else{
      $this->renderPartial('kicker', array( 'channel'=>$channel, true, true));
 }


View:
<div id="kicker">
</div>
<?php 

echo CHtml::ajaxLink('KOPNIJ', array('/djpanel/sc/kick'), array(
      'type'=>"POST",
      'data'=>array(
             'YII_CSRF_TOKEN' => Yii::app()->request->csrfToken,
             'cn'=>'hello',
              ),
      'update'=>'#kicker',
      )
);


It looks like there is no JS responsible for ajaxLink on renderPartial.

Any ideas ?
0

#2 User is offline   Ankit Modi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 891
  • Joined: 19-February 13
  • Location:India

Posted 06 March 2013 - 12:57 AM

Hi,

Please change the


$this->renderPartial('kicker', array( 'channel'=>$channel), false, true);

Best Regards,
Ankit Modi
Thanks,
Ankit Modi
Skype : amodi06
0

#3 User is offline   Balu 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 153
  • Joined: 09-August 11
  • Location:Kerala, India

Posted 06 March 2013 - 01:25 AM

Make sure in controller acces is allowed

public function accessRules()
	{
		return array(
			array('allow',  // allow all users to perform 'index' and 'view' actions
				'actions'=>array('index','Kick'),
				'users'=>array('*'),
			),
}

0

#4 User is offline   Manoj M 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 09-September 12
  • Location:Dharapuram

Posted 06 March 2013 - 04:04 AM

thats correct make it as false,true, it ll work
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