Yii Framework Forum: Kartik-Widget GridView Filter TYPEAHEAD inactive - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Kartik-Widget GridView Filter TYPEAHEAD inactive [solved] Rate Topic: -----

#1 User is offline   tklustig 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 219
  • Joined: 20-April 17
  • Location:Hannover

Posted 25 July 2017 - 06:03 AM

Following code throws out no error,but it's completely inactive,respectively redundant. JQuery is filtering nothing! Any ideas, how to fix this?
$gridColumn = [
        [
        'attribute' => 'ort',
        'label' => 'Stadt',
        'value' => function($model) {
            if ($model->ort) {
                return $model->ort;
            } else {
                return NULL;
            }
        },
        'filterType' => GridView::FILTER_TYPEAHEAD,
        'filterWidgetOptions' => [
            'pluginOptions' => ['highlight' => true],
            'dataset' => [['local' => ArrayHelper::map(plz::find()->orderBy('ort')->asArray()->all(), 'id', 'ort'),]
            ]],
        'filterInputOptions' => ['placeholder' => 'JQuery will filter...'],
        'format' => 'raw'
    ],
    .
    .
    .
]

0

#2 User is offline   tklustig 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 219
  • Joined: 20-April 17
  • Location:Hannover

Posted 30 July 2017 - 10:33 AM

Solved problem using SELECT2-Filter.LiveSearch is implemented by this widget...
.
.
.
        [
            'attribute' => 'name',
            'label' => 'Land',
            'value' => function($model) {
                if ($model->name) {
                    return $model->name;
                } else {
                    return NULL;
                }
            },
            'filterType' => GridView::FILTER_SELECT2,
            'filter' => ArrayHelper::map(Country::find()->all(), 'name', 'name'),
            'filterWidgetOptions' => [
                'pluginOptions' => ['allowClear' => true],
            ],
            'filterInputOptions' => ['placeholder' => 'name', 'id' => 'grid-country-search-name'],
            'format' => 'raw'
        ],
.
.
.

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users