Yii Framework Forum

Use Ajax in cgridview search for on type filter the rows


(MHJN13) #1

Hi
I have a problem with search on cgridview.
I want to use Ajax for filter data.
I want to set ‘filter on type’ in cgridview default search.
my cgridview is:

$this->widget('zii.widgets.grid.CGridView',
array(
'dataProvider'=>$dataProvider,
'filter'=>$model,
'columns'=>array(
	'name',
	'fname',
	'post',
	'tel',
	'mobile',
	'email',
	array(
		'class'=>'CButtonColumn') 
	,)
));

Can Anyone help me to fix my problem.
I use yii version 1 and know in yii version 2 can use

ajax begin
ajax end

But in yii version 1 can’t use.
Thanks for help.


(Alirz23) #2

there are lot of wiki articles on using ajax with old CGridview here is one to get you started

https://www.yiiframework.com/wiki/323/dynamic-parent-and-child-cgridview-on-single-view-using-ajax-to-update-child-gridview-via-controller-after-row-in-parent-gridview-was-clicked