2017 © Pedro Peláez
 

yii2-extension yii2-typeahead

Typeahead widget for Yii2 framework.

image

yii-cms/yii2-typeahead

Typeahead widget for Yii2 framework.

  • Wednesday, November 11, 2015
  • by gonimar
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3,913 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 13 % Grown

The README.md

yii2-typeahead

Typeahead widget for Yii2 framework., (*1)

            <?php echo Typeahead::widget([
                'id' => 'typeahead-id',
                'name' => 'typeahead-name',
                'clientOptions' => [
                    'displayKey' => 'value',
                    'templates' => [
                        'suggestion' => new JsExpression("function(data){ return '<p>' + data.value + '</p>'; }"),
                    ],
                ],
                'events' => [
                    'typeahead:selected' => new JsExpression(
                        'function(obj, datum, name) { window.location = datum.url; }'
                    ),
                ],
                'bloodhoundOptions' => [
                    'remote' => [
                        'url' => Url::to(['controller/action']) . '?q=%QUERY',
                        'ajax' => ['data' => [
                            'id' => $model->id,
                        ]],
                        'replace' => new JsExpression("
                            function(url, query) {
                                return url.replace('%QUERY', query);
                            }
                        "),
                        'filter' => new JsExpression("
                            function(list) {
                                return $.map(list, function(item) { return { value: item.name, url: item.url }; });
                            }
                        "),
                    ],
                ],
                'options' => ['class' => 'form-control', 'placeholder' => 'Title', 'autofocus' => true],
            ]);

The Versions

11/11 2015

dev-master

9999999-dev

Typeahead widget for Yii2 framework.

  Sources   Download

The Requires

 

by Гонимар Сергей

yii2 typeahead

11/11 2015

0.2

0.2.0.0

Typeahead widget for Yii2 framework.

  Sources   Download

The Requires

 

by Гонимар Сергей

yii2 typeahead

01/07 2015

v0.1

0.1.0.0

Typeahead widget for Yii2 framework.

  Sources   Download

The Requires

 

by Гонимар Сергей

yii2 typeahead