Answer the question
In order to leave comments, you need to log in
How to search by field in GridView?
Good afternoon! Using a stored procedure, I get the data as an array and then format it as a Grid Can you tell me how to search for each field in a GridView?
Controller
$dataProvider = new ArrayDataProvider([
'allModels' => $records,
'sort' => [
'attributes' => ['State Time'],
],
'pagination' => [
'pageSize' => 15,
],
]);
return $this->render('index',compact('dataProvider'));
echo GridView::widget([
'dataProvider'=>$dataProvider,
'filterModel'=>$searchModel,
'columns'=>[
['class' => 'yii\grid\SerialColumn'],
'RecipientLegalName',
'Service Name',
'Payment Identifier',
'Payment Number',
'Payment Account',
'Recipient Sum, MDL',
'Payment State',
'State Time',
],
]);
Answer the question
In order to leave comments, you need to log in
I don't use model generator.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question