Yii Framework Forum: question in clistview ajax paginate - Yii Framework Forum

Jump to content

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

question in clistview ajax paginate question in clistview ajax paginate Rate Topic: -----

#1 User is offline   lijl2k3 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 09-May 10

Posted 09 May 2010 - 06:11 PM

I made a clistview with the ajax function which shows text from a model when clicked. It works well in the first page, but doesn't work in next pages. It seemd the callback function doesn't work in next pages. The scripts are as the following:

views:
index.php
<?php $this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$dataProvider,
	'itemView'=>'_view',
)); ?>


_view.php
<?php $images=Yii::app()->request->baseUrl."/images";?>
	
	<div class="reset"></div>
	<ul class="listview">
	<li class="datetab">
	<?php echo (CHtml::encode($data->date)); ?>
	</li>
	<?php //$url=CController::createUrl('',array('introid'=>2));
		$url1=CController::createUrl('tickintro', array('introid'=>2, 'tickid'=>$data->id,));
		$url2=CController::createUrl('tickintro', array('introid'=>1, 'tickid'=>$data->id,));
	
	?>
	<?php $introdiv="#introdiv".$data->id;
	?>
	<li class="price"><?php echo CHtml::ajaxLink($data->getAttributeLabel('price_king'),$url1, array('update' => $introdiv, 'type' => 'GET')); ?>:
	<?php echo CHtml::encode($data->price_king."/ticket"); ?>
	
	</li>
	<li>|</li>
	<li class="price"><?php echo CHtml::ajaxLink($data->getAttributeLabel('price_emperor'),$url2,array('update' => $introdiv, 'type' => 'GET')); ?>:</b>
	<?php echo CHtml::encode($data->price_emperor."/set"); ?>
	</li>
	
	<li class="order"><?php echo CHtml::link(CHtml::image("$images/btn_order.gif"), array('subinfo/create', 'tickid'=>$data->id)); ?>
	</li>	
	</ul>
	<div class="reset"></div>
	
	<div id="<?php echo "introdiv".$data->id;?>"></div>

controller:
public function actionTickintro(){
		if (isset($_GET['introid'])&&(isset($_GET['tickid']))){
			$introid=$_GET['introid'];
			$intro=tickintro::model()->findbyPk($introid);
			$this->renderPartial('_introview',array('theintro'=>$intro->intro));
		}

	}
views for _introview.php:
<div class="introview">
	<?php
	if(isset($theintro))	
	echo $theintro;
	?>
</div>

When the label "price_king" or "price_emperor" is clicked, it should trigger the function"tickintro" to show some introtext from model "tickintro". But it only works in the first page.
Has anyone met such problem? Or can you figure out mistakes in the scripts and solve it?
Thank you for your help in advance.
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 13 May 2010 - 05:24 AM

try to do
$this->renderPartial('_introview',array('theintro'=>$intro->intro), false. true);  
.

Check the documentation here
0

#3 User is offline   james2010 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 19-February 10

Posted 13 May 2010 - 05:51 AM

View Postzaccaria, on 13 May 2010 - 05:24 AM, said:

try to do
$this->renderPartial('_introview',array('theintro'=>$intro->intro), false. true);  
.

Check the documentation here


ive got same issue

http://www.yiiframew...script-problem/
0

#4 User is offline   james2010 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 19-February 10

Posted 14 May 2010 - 05:55 AM

just worked with ajaxUpdate' => false

but if Ajax used for paginate. its not working
1

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