我在 yii2 中使用 kartik 网格库
这行得通。
[ 'attribute' => 'status', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ['Active' => 'Active', 'In Active' => 'In Active'], 'filterWidgetOptions' => [ 'pluginOptions' => ['allowClear' => true], ], 'filterInputOptions' => ['placeholder' => 'Select'], ]
但这并不
[ 'attribute' => 'status', 'filterType' => '\kartik\widgets\Select2', 'filter' =>['Active' => 'Active', 'In Active' => 'In Active'], 'filterWidgetOptions' => [ 'pluginOptions' => ['allowClear' => true], ], 'filterInputOptions' => ['placeholder' => 'Select'], ]
为什么 ?我需要使用第 2 点方法。但它不起作用。