Yii Framework Forum: Cgridview Update Problem - Yii Framework Forum

Jump to content

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

Cgridview Update Problem Rate Topic: -----

#1 User is offline   mbala 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 174
  • Joined: 21-July 12
  • Location:Chennai, Tamilnadu, India

Posted 10 December 2012 - 06:50 AM

I used two gridview in my view page for two different status. It is working fine on page load. My page load format is

Gridview1
<gridview1>
Gridview2
<gridview2>

But, When i use form search or pagination, My format change
Gridview1
<gridview1>
<gridview2>

Gridview2
<gridview2>


Here gridview 1 and 2 load again. Its ok but page load gridview2 still there.
Note: I used different id for gridview and both gridview display same table but different model, different data like status
0

#2 User is offline   Kollipara Rama Krishna 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 12-May 12

Posted 10 December 2012 - 07:29 AM

share your code or share your problem in screen shots so we can understand better
0

#3 User is offline   mbala 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 174
  • Joined: 21-July 12
  • Location:Chennai, Tamilnadu, India

Posted 10 December 2012 - 07:46 AM

	
incontroller admin action
	public function actionAdmin()
	{
		$category='';
		$model=new Subcategorymaster('search');
               $model1=new Subcategorymaster('search');
		$model->unsetAttributes();  // clear any default values
		if(isset($_GET['Subcategorymaster']))
			$model->attributes=$_GET['Subcategorymaster'];

		$this->render('admin',array(
			'model'=>$model,'model1'=>$model1
		));
	}

in view admin.php
-------------------
<?php $this->renderPartial('_search',array(	'model'=>$model,)); ?>
</div>
//gridview 1
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'subcategorymaster-grid',
	'dataProvider'=>$model->searchactive(),
	//'filter'=>$model,
	'columns'=>array(
         .............
        )
       ));

//gridview 2
 $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'subcategorymaster-grid',
	'dataProvider'=>$model->searchinactive(),
	//'filter'=>$model,
	'columns'=>array(
         .............
        )
       ));

http://www.yiiframew...&attach_id=3587

Attached File(s)


0

#4 User is offline   mbala 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 174
  • Joined: 21-July 12
  • Location:Chennai, Tamilnadu, India

Posted 10 December 2012 - 08:04 AM

Sorry guys. By mistake i put same id again. Working fine now.
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