2017-05-29 54 views
0

我使用卡爾蒂克電網LIB在yii2yii2電網濾波器類型不工作

  1. 這工作。

    [ 
    'attribute' => 'status', 
    'filterType' => GridView::FILTER_SELECT2, 
    'filter' => ['Active' => 'Active', 'In Active' => 'In Active'], 
    'filterWidgetOptions' => [ 
        'pluginOptions' => ['allowClear' => true], 
    ], 
    'filterInputOptions' => ['placeholder' => 'Select'], 
    ] 
    
  2. 但這並不

    [ 
    'attribute' => 'status', 
    'filterType' => '\kartik\widgets\Select2', 
    'filter' =>['Active' => 'Active', 'In Active' => 'In Active'], 
    'filterWidgetOptions' => [ 
        'pluginOptions' => ['allowClear' => true], 
    ], 
    'filterInputOptions' => ['placeholder' => 'Select'], 
    ] 
    

爲什麼?我需要使用第2點方法。但它不起作用。

+0

你確定''filterType'的值是這兩者之間的唯一區別嗎?它應該工作... – Bizley

+0

是的,這是唯一的區別。 – Ish

回答

0

將過濾器類型更改爲'\ kartik \ select2 \ Select2'並且它工作正常。