Yii Tbrelationalcolumn Ajax Pagination Trigger Full Page Change Instead Of Subgrid

I have a Yii booster TbRelationalColumn and it work perfectly, now when the records are more, the pagination is showing correctly but when i change the page the whole grid disappears and only that grid is showing which is currently selected, i have to refresh the page to get back all the related columns. Here is my code:


$this->widget('bootstrap.widgets.TbExtendedGridView', array(

            'filter'=>$model,

            'dataProvider' => $model->search(),

             'pager'=>array(

                'firstPageCssClass'=>'previous',

                'lastPageCssClass'=>'next',

                ),

            'columns' => array_merge(array(

             array('class'=>'bootstrap.widgets.TbRelationalColumn',

                    'name' => 'name',

             'url' =>$this->createUrl('XXXXXXX'),

             'value'=> $data->name

              )

            ),array( 'XXXXXX','XXXXXX',

    array(

        'class'=>'CButtonColumn',

        'template'=>'{update}',

        'buttons'=>array(

        'update' => array(

        'label'=>'',

        'imageUrl'=>Yii::app()->request->baseUrl.'/images/update.png',

      ),

     ),

),

  )),

));

Now the problem is that how can i maintain the current view when we change the page only related columns page is change not the whole grid?

help me guys…am waited since yesterday…

Hi,

When u click pagination u can call a afterAjaxupdate function after dataprovider and call the bootstrap.widgets.TbRelationalColumn widgets


'afterAjaxUpdate'=>'function(id, options){

				alert(id);

			}',



Hope it will be done.

please post your model(rules) code to make sure that relationship is perfect, I m using the same table with more 30thousand fields, i had some strange behaviour when i realize the whole problems was in relationship, b/c the data was not rendering due to problem in relationship!

the data is rendering perfectly.Nothing problems is occurs with the model.

i think you didnt understand my problem.I have all the things working.Only but when i have related table data with pagination,When i go to second page, the whole grid becomes that subgrid and shows second page,The other data is again rendered after if i reload the page.Problem with ajax pagination,The paginater hooks action with full Cgrid not with that subgrid only.

Hi,

please make sure check this renderPartial(Pass the fourth parameter)


$this->renderPartial('artist_list',$params,false,true);

i did this earlier, I think i should post more code here to be more clear :

The controller action which is rendering the partial data-


 public function actionXXXX($id){

         //Logic which works good here.

               

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

                                    'id' => Yii::app()->getRequest()->getParam('id'),

                                    'dataProvider'=>$dataProvider,

                                    'model' => $model),false,true);

        

        }

This is Partial Rendered _order Grid:


$this->widget('bootstrap.widgets.TbExtendedGridView', array(

'type'=>'striped bordered',

'dataProvider' => $dataProvider,

    'filter'=>$order,

   'id'=>'test_'.$id,

   'pager'=>array(

                    'header'=>'',

                    'maxButtonCount'=>5,

                    'selectedPageCssClass'=>'active',

                    'hiddenPageCssClass'=>'disabled',

                    'firstPageCssClass'=>'previous',

                    'lastPageCssClass'=>'next',

                    ),

  'columns'=>array(  // Data Columns    )

));

Hi

When you create the function u must be


$deviceDataProvider=new CArrayDataProvider($data_arr, array('id'=>'id',

							'pagination'=>array('pageSize'=>10),

		));

it’s automatically created pagination