For benefit of others here’s the full solution.
Install combobox extension.
First patch your combobox javascript with this.
In the CGridView column definition add the widget:
array(
'name'=>'column_name',
'filter'=>$this->widget('ext.combobox.EJuiComboBox', array(
'model' => $model,
'attribute' => 'attributeName',
'data' => CHtml::listData(YourModel::model()->findAll(),'id','description'),
'options' => array(
'allowText' => false,
),
'assoc'=>true,
),true),
Since on the CGridView update the javascript is lost we need to reinstall ComboBox on every change.
So in the CGridView options, before ‘columns’, add:
'afterAjaxUpdate' => 'reinstallComboBox',
then later on on the view:
<?php Yii::app()->clientScript->registerScript('re-install-combobox', "
function reinstallComboBox(id, data) {
jQuery('#YourModel_attributeName_combobox').combobox({'allowText':false});
}
"); ?>
Replace YourModel with your model name, attributeName with the attribute name you’re trying to filter.