renderpartial onclick of ajax link takes time to load

Hi all… I am in a very weird situation…

I have an ajax link on click of which m doing renderParital of Clistview…

here’s my ajax link…


echo CHtml::ajaxLink('FAVOURITES',

array('Favourites/account_favourite/'.$Member_ID), // the URL for the AJAX request. If empty, it is assumed to be the current URL.


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

'beforeSend' => 'function(){

	$("#loader").removeClass("beforeloading");

      $("#loader").addClass("loading");}',


 

	'type' =>'POST',


),array('class'=>'ajaxtabs','id'=>'favouritesactive'));


?>

And this is the function whick the ajax link calls…

public function actionAccount_favourite($id)


{


$criteria=new CDbCriteria;


	$criteria->select = "*";


	$criteria->join="inner join favourites f on t.News_ID=f.Post_ID and f.Type='News'";


	$criteria->condition="f.member_ID=".$id;


	


	$dataProvider=new CActiveDataProvider('News',array('criteria'=>$criteria, 'pagination'=>array( 


            'pageSize'=>5, 


        ), 

));


$this->renderPartial('account_details',array(

			'dataProvider'=>$dataProvider,

		),'',true),


))


};

view account details has the clist view… it loads but takes a long time… any clue why this happens? if i set the last parameter of renderpartial as false it loads fast… but i cannot do that cos then clistview pagination fails…

Hi mithila!! i have the same problem. What did you do to solve it??? regards from spain!

Try changing your controller as below. It`ll get delayed when try to re register jquery.js




public function actionUserCallDetails()

{

	$this->layout='';


	$model = new LogSearchForm();

	

	$data_provider = $model->getCallDetails();

	

	Yii::app()->clientScript->scriptMap['jquery.js'] = false;

	Yii::app()->clientScript->scriptMap['jquery.min.js'] = false;

	

	$this->renderPartial('user_call_details',array(

		'model' => $model,

		'data_provider' => $data_provider

	),false,true);

	

	Yii::app()->end(); 

}

I already have that code on my action… this is what i have




public function actionPopUpLogin(){

		

		$this->layout='';

		Yii::app()->clientScript->scriptMap['jquery.js'] = false;

        Yii::app()->clientScript->scriptMap['jquery.min.js'] = false;

		

		$model = Yii::app()->user->um->getNewCrugeLogon('login');

		

		Yii::app()->user->setFlash('loginflash',null);

		

		Yii::log(__CLASS__."\nactionLogin\n","info");

		

		$this->performAjaxValidation('logon-form',$model);

		

		if(isset($_POST[CrugeUtil::config()->postNameMappings['CrugeLogon']]))

		{

			$model->attributes=$_POST[CrugeUtil::config()->postNameMappings['CrugeLogon']];

			if($model->validate()){

				if($model->login(false)==true){

					Yii::log(__CLASS__."\nCrugeLogon->login() returns true\n","info");

					$this->redirect(Yii::app()->user->returnUrl);

				}else{

					Yii::app()->user->setFlash('loginflash',Yii::app()->user->getLastError());

				}

			}else{

				Yii::log(__CLASS__."\nCrugeUser->validate es false\n".CHtml::errorSummary($model),"error");

			}

		}

		$this->renderPartial('_pop_up_login',array('model'=>$model),false,true);

	}




I think it maybe could be because my model, it’s in a module… could be?