Answer the question
In order to leave comments, you need to log in
Yii. How to make a custom filter in CGridView?
How to make the filter according to the data different in structure from the model?
dataProvider - receives data using the Purchase::getInfoAllUser() function.
Normally filter is equal to $model , but in this case the fields of the model are not equal to the fields to be displayed (some calculations are done before the output). What exactly needs to be fed in filter ?
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider' => Purchase::getInfoAllUser(),
'filter' => ??????,
'columns' => array(
array('name' => 'id', 'filter' => false),
array('name' => 'user', 'filter' => Purchase::getInfoAllUser()),
array('name' => 'summary_cost', 'filter' => false),
)
));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question