Strange cgridview

Hi all,i have a problem maybe some of you can give me ideas for this problem.

i put 4 Cgrid view in 1 view,this is the code




<?php

$this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'child-data-grid',

	'dataProvider'=>$model->findAnaks1($model->id),

	//'enablePagination'=>false,

	//'filter'=>$model,

	'columns'=>array(

		//'id',

		'child_code',

		'child_name',

		'gender_id',

		'pob',

		'dob',

		array(

			'header'=>'Action',

			'value'=>'CHtml::link( \'View\', array(\'ChildData/view\',\'id\'=>$data->id))' ,

			'type'=>'raw',

		),

		//array('name'=>'child_Data', 'value'=>'$data->childData->lksa_data_id'),


	),

));


?>

<h1>Anak Dalam Asuhan Panti </h1>

<?php

$this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'child-data-grid',

	'dataProvider'=>$model->findAnaks1($model->id),

	//'enablePagination'=>false,

	//'filter'=>$model,

	'columns'=>array(

		//'id',

		'child_code',

		'child_name',

		'gender_id',

		'pob',

		'dob',

		array(

			'header'=>'Action',

			'value'=>'CHtml::link( \'View\', array(\'ChildData/view\',\'id\'=>$data->id))' ,

			'type'=>'raw',

		),

		//array('name'=>'child_Data', 'value'=>'$data->childData->lksa_data_id'),


	),

));

?>

<h1>Anak Dalam Asuhan Keluarga </h1>

<?php

$this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'child-data-grid',

	'dataProvider'=>$model->findAnaks2($model->id),

	//'enablePagination'=>false,

	//'filter'=>$model,

	'columns'=>array(

		//'id',

		'child_code',

		'child_name',

		'gender_id',

		'pob',

		'dob',

		array(

			'header'=>'Action',

			'value'=>'CHtml::link( \'View\', array(\'ChildData/view\',\'id\'=>$data->id))' ,

			'type'=>'raw',

		),

		//array('name'=>'child_Data', 'value'=>'$data->childData->lksa_data_id'),


	),

));

?>

<h1>Anak yang melebihi 18 tahun </h1>

<?php

$this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'child-data-grid',

	'dataProvider'=>$model->findAnaks3($model->id),

	//'enablePagination'=>false,

	//'filter'=>$model,

	'columns'=>array(

		//'id',

		'child_code',

		'child_name',

		'gender_id',

		'pob',

		'dob',

		array(

			'header'=>'Action',

			'value'=>'CHtml::link( \'View\', array(\'ChildData/view\',\'id\'=>$data->id))' ,

			'type'=>'raw',

		),

		//array('name'=>'child_Data', 'value'=>'$data->childData->lksa_data_id'),


	),

));

?>



actually it works fine until i want going to page 2 in one of my cgridview,there are the picture before 2278

Capture.JPG

You have this


'id'=>'child-data-grid',

for every grid. Make that unique and your problem will be gone.

try use ajaxUpdate= false in cgridview. can Solve this problem. work fine for me.

… and refuse CGridView AJAX benefits. In this case you should follow enfield’s solution too to get things work proper way.

thanks i’ve changed id and now it works great :D