php - How can I use a simple Dropdown list with filtering in the search box of GridView::widget, Yii2? -
i have 2 tables "attendance" attributes id
, status
, date
, "staff". staff_id
used foreign key in attendance table. in _form.php of attendance used
<?= $form->field($model, 'status')->dropdownlist([ 'present' => 'present', 'absent' => 'absent', 'leave' => 'leave',], ['prompt' => 'select status']) ?>
for dropdown. want dropdown in gridview search columns property of filtering , searching. gridview filtered dropdown list have. when choose value dropdown list, should search on base of choosed value. highly appriciated.
i think question status field
<?= gridview::widget([ 'dataprovider' => $dataprovider, 'filtermodel' => $searchmodel, 'columns' => [ ['class' => 'yii\grid\serialcolumn'], ........ [ 'attribute' => 'status', 'label' => 'status', 'filter' => [ 'present' => 'present', 'absent' => 'absent', 'leave' => 'leave',] ], ......
Comments
Post a Comment