There is a task after clicking on the button to transfer search results from the GridView to the controller. Tell me, how can this be done?
The code generated through Gii.
GridView wrapped in Pjax.
|
1 answer
author, correct me, if not right.
GridView is a data rendering widget that takes data from a DataProvider, which in turn should be called up in a controller in a good way.
With the widget you just draw the data.
With options, it seems to me
1) ajax request back, and catching through Yii::$app->request->isAjax -> so myself
2) In your DataProvider, you can draw the result yourself before displaying in the view,
$query = News::find(); $dataProvider = new ActiveDataProvider( [ 'query' => $query ] );введите сюда код # нужный нам кусочек # например, должен полагать, вам нужно знать, сколько значений нашлось $myData = $query->count(); </pre> 3) as an option, you can inherit the GridView itself, and there already (if really specific logic) do logging
|