kartik-v / yii2-grid

Enhanced GridView with various utilities for Yii Framework 2.0
http://demos.krajee.com/grid
Other
558 stars 302 forks source link

"kartik\select2\Select2" !== "\kartik\select2\Select2" #1045

Closed rafalzareba closed 1 year ago

rafalzareba commented 1 year ago

filter for Select2 class is diffrent than const of Select2 in DataColumn

        [
          'class' => DataColumn::class,
          'attribute' => 'category',
          'filterType' => Select2::class, <--- this return kartik\select2\Select2 !!
          [...]
        ]

and follow to kartik\grid\DataColumn

`

         [...]
        if ($this->filterType === GridView::FILTER_SELECT2 || $this->filterType === GridView::FILTER_TYPEAHEAD) {
            $options['data'] = $this->filter;
        }
        [...]

`

and is false because const GridView::FILTER_SELECT2 = \kartik\select2\Select2 with \ in prefix

kartik\select2\Select2 !== \kartik\select2\Select2