Not working filter elements in the CGridView. Tell me how to fix this? For example, you must select a category, choose "Baby", but nothing happens. SiteController
public function actionIndex()
{
$model = new Page;
$dataProvider=new CActiveDataProvider('Page', array(
'criteria'=>$criteria,
'sort' => array(
'defaultOrder'=>array(
'created'=>"DESC"
)),
'pagination'=>array(
'pageSize'=>30,
),
));
// renders the view file 'protected/views/site/index.php'
// using the default layout 'protected/views/layouts/main.php'
$this->render('index', array('dataProvider'=>$dataProvider,'model'=>$model));
}
index.php
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider' => $dataProvider,
'enableSorting'=>true,
'filter'=>$model,
'columns' => array(
'title' => array(
'name'=>'title',
'type'=>'raw',
'value'=>'CHtml::link($data->title,Yii::app()->request->baseUrl."/page/".$data->id)',
'headerHtmlOptions' => array('style'=>'width:250px;'),
),
'created' => array(
'name' => 'created',
'value' => 'date("j.m.Y H:i", $data->created)',
'headerHtmlOptions' => array('style'=>'width:90px;'),
'type'=>'raw',
),
'category_id' => array(
'name' => 'category_id',
'value' => '$data->category->title',
'filter' => Category::allCategory(),
'headerHtmlOptions' => array('style'=>'width:150px; text-align:center;'),
'type'=>'raw',
'sortable'=>TRUE
),
'subcategory_id' => array(
'name' => 'subcategory_id',
'value' => '$data->subcategory->title',
'filter' => Subcategory::allCategory(),
'headerHtmlOptions' => array('style'=>'width:150px; text-align: center;'),
'type'=>'raw',
),
'condition_id' => array(
'name' => 'condition_id',
'value'=> '$data->condition->title',
'filter' => Condition::allAttributes(),
'headerHtmlOptions' => array('style'=>'width:90px;'),
'type'=>'raw',
),
),
));
Thanks in advance for answers and assistance.