Php yii2网格过滤器类型不工作
我正在yii2中使用kartik网格库Php yii2网格过滤器类型不工作,php,filter,yii2,grid,kartik-v,Php,Filter,Yii2,Grid,Kartik V,我正在yii2中使用kartik网格库 这很有效 [ 'attribute' => 'status', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ['Active' => 'Active', 'In Active' => 'In Active'], 'filterWidgetOptions' => [ 'pluginOptions' => ['allowClear' => t
[
'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'],
]
为什么??我需要使用第二点方法。但它不起作用。将过滤器类型更改为“\kartik\select2\select2”,它起作用。美国“过滤器类型”=>GridView::filter\u select2,el composer usado es使用kartik\grid\GridView强>
'filterType' => GridView::FILTER_SELECT2,
'filter' => ArrayHelper::map(Entidad::find()->asArray()->all(),'id', 'nombre'),
filterWidgetOptions' => [
'pluginOptions' => ['allowClear' => true],
],
'filterInputOptions' => ['placeholder' => 'Selección'],
您确定
'filterType'
值是这两者之间的唯一区别吗?它应该有用……是的,这是唯一的区别。