Answer the question
In order to leave comments, you need to log in
Why is the search model not working in the GridView?
There is a gridView that works with a mongoDB collection.
Created a separate model for the collection and a separate search model with model inheritance.
I write settings in gridView, but when selecting a value in the list, after reloading the table, there is no call to the search model, I check the call as Yii::error().
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
[
'attribute' => 'created_at',
'value' => function(Visitors $model) {
return $model->getCreated();
}
],
[
'attribute' => 'name_bot',
'filter'=> ArrayHelper::map(Bots::getPairs(), 'id', 'name')
],
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