In Yii CGridview you can replace default text-field with drop-down to filter records. You just need to add following line in your columns array. Ex. I have added "Category" column along with drop-down filter.
'category'=>array( 'name' => 'category', 'value' => '$data->category', 'filter'=> CHtml::listData(CustomerSpendings::model()->findAll(array('order'=>'category')), 'category', 'category') ),
No comments:
Post a Comment