Reload Page When We Filter Data

Hi,

Excuse me in advance for my English, I have difficulty expressing myself.

I have a problem with the load time a page. In a page, I have two CGridView, one with few data and a other with many data ( load time of this gridview is 1 minute minimum).

When I made a filter in first gridview, the page load fully, it is a problem for me.

it is possible to charge only first gridview, in order do not wait for 1 minutes.

Can we modify the framework when we filter for don’t recharge fully page, but only the part concerned.

Thanks in advance,

Hi and welcome to Yii!

CGridView by default uses ajax method, so page shouldn’t load entirely

could you post your view code of the two CGridViews ?

First gridview


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

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

        'filter'=>$model,

       // 'ajaxUpdate'=>'true',

	'columns'=>array(

		'f_task_id',

	a	'f_title',

		'f_description',

		'f_date_schedule',

		'f_command_site',

		array(

			'class'=>'CButtonColumn',

                        'template'=>'{view} {delete}',

		),

	),

));

Code call a second gridview


$dataProvider = new CActiveDataProvider('t_esi_site', array(

    'criteria'=>array(

      

        'condition'=>"t.f_site_id IN (

        	SELECT DISTINCT f_site_id

        	FROM t_esi_site_node

        	INNER JOIN t_esi_task_exec ON(t_esi_site_node.f_node_id = t_esi_task_exec.f_node_id)

        	LEFT OUTER JOIN t_esi_task_event ON(t_esi_task_exec.f_last_event_id = t_esi_task_event.f_event_id)

        	WHERE t_esi_task_event.f_event != 'TERMINATED' OR t_esi_task_exec.f_last_event_id is NULL

        )",

        'order'=>'t.f_site_id',

    ),

    'pagination'=>array(

        'pageSize'=>10,

    ),

));


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

    'dataProvider'=>$dataProvider,

    'itemView'=>'/t_esi_task_exec/_TaskofSite',

));

_TaskofSite:


  $nbtask=t_esi_task_exec::countDependantTasks($data->f_site_id);

    echo CHtml::link("<b>$data->f_site_id</b>",array('/t_esi_site/view&id='.$data->f_site_id));


    $dataProvider=new CActiveDataProvider('t_esi_task_exec', array(

        'data'=> t_esi_task_exec::getTreeOrder(0, $data->f_site_id),


    ));


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

        'dataProvider'=>$dataProvider,

        'columns'=>array(

            array(

                'name'=>'Task Id',

                'value'=>'$data->getTreeTaskIdString()',

            ),

            'task.f_title',

            'task.f_description',

            'last_event.f_event',

            array(

                'header'=>'Server Node',

                'value'=>'$data->node->getCommonName()',

                ),

            array(  'class'=>'CButtonColumn',

                    'template'=>'{view}',

                    'viewButtonUrl'=>'Yii::app()->createUrl("/t_esi_task_exec/view", array("id" => $data->f_task_exec_id))',

                    ),

            ),

        'template'=>"{items}"

        )

    );

    if ($nbtask>0)

    {

        echo "And $nbtask dependant task(s) remaining";

    }

Your code seems ok

Trace your request (when check a filter) on tab network of your firebug,

Also check your javascript code (if you added)