0
在卡爾蒂克的GridView我想與選擇2型添加濾鏡象下面這樣:filterWidgetOptions無效(yii2)
[
'attribute' => 'product_id',
'value' => function ($model) {
return $model->product->name;
},
'filterType'=>GridView::FILTER_SELECT2,
'filter'=>ArrayHelper::map(\app\models\ProductWord::find()->asArray()->all(), 'name', 'name'),
'filterWidgetOptions'=>[
'pluginOptions'=>['allowClear'=>true, 'minimuminputLength' => 3],
],
'filterInputOptions'=>['placeholder'=>'Any Product', 'multiple' => true ],
'group'=>true, // enable grouping
'label' => 'Product',
'headerOptions' =>
['style'=>'max-width: 70%; font-size: 12px;overflow: auto; word-wrap: break-word;'],
'contentOptions' =>
['style'=>'max-width: 70%; font-size: 12px;overflow: auto; word-wrap: break-word;'],
],
但結果是filterWidgetOptions
不起作用。我想補充allowclear
和minimuminputLength
,但它不工作。我做什麼錯王氏代碼?
謝謝