How to transfer data for searching and sorting from several AR models to a CGridView widget? I don’t like to go down to the code, but ... basically the code is basically generated by the gii module:
$this->widget('zii.widgets.grid.CGridView', array( 'id'=>'ch-grid', 'dataProvider'=>$model->search(), 'filter'=>$model, 'columns'=>array( array( 'name' => 'title', 'header' => 'Заголовок', ), array( 'name' => 'category.title', 'header' => 'Категория', 'filter' => CHtml::listData(Category::model()->findAll(), 'id', 'title'), ), array( 'name' => 'chValue.title', 'header' => 'Величина' ), array( 'class'=>'CButtonColumn', ), ),
))
the problem is that the widget didn’t care about searching and sorting in the fields selected using relationships (category.title). I do not understand how it works. please explain to me what i'm doing wrong and how to add a search for different models in one grid