Reputation: 205
I have created a dropdown in yii2 gridview in search box as
[
'attribute'=>'attribute name',
'filter'=>array("ID1"=>"Name1","ID2"=>"Name2"),
],
I tried many ways to give placeholder but cant... so how to add placeholder??
Upvotes: 3
Views: 1119
Reputation: 9358
[
'attribute'=>'attribute name',
'filter'=>array("ID1"=>"Name1","ID2"=>"Name2"),
'filterInputOptions' => [
'class' => 'form-control',
'prompt' => 'Select Option'
],
],
Upvotes: 6
Reputation: 96
Try it,,
[
'attribute'=>'attribute name'
'filter' => Html::activeDropDownList($searchModel, 'attribute name', array("ID1"=>"Name1","ID2"=>"Name2"),['class'=>'form-control','prompt' => 'Select Name']),
]
Hope help,,,
Upvotes: 0