2017 © Pedro Peláez
 

yii2-extension yii2-widget-easyautocomplete

Yii2 widget for the EasyAutocomplete plugin (https://github.com/pawelczak/EasyAutocomplete).

image

gitrequests/yii2-widget-easyautocomplete

Yii2 widget for the EasyAutocomplete plugin (https://github.com/pawelczak/EasyAutocomplete).

  • Thursday, November 16, 2017
  • by gitrequests
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 25 % Grown

The README.md

yii2-widget-easyautocomplete

Yii2 widget for the EasyAutocomplete plugin (https://github.com/pawelczak/EasyAutocomplete)., (*1)

Install

The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies., (*2)

To install, either run, (*3)

$ php composer.phar require gitrequests/yii2-widget-easyautocomplete "dev-master"

or add, (*4)

"gitrequests/yii2-widget-easyautocomplete": "dev-master"

to the require section of your composer.json file., (*5)

Usage

echo EasyAutocomplete::widget([
    'pluginOptions' => [
        'url' => Url::to('data/countries.json'),
        'getValue' => 'name'
    ]
]);

You can also use this widget in an [[ActiveForm]] using the [[ActiveField::widget()|widget()]] method, for example like this:, (*6)

echo $form->field($model, 'address')->widget(EasyAutocomplete::className(), [
    'pluginOptions' => [
        'url' => Url::to('data/countries.json'),
        'getValue' => 'name'
    ]
]);

For use with list events||functions (custom match function for example):, (*7)

echo $form->field($model, 'address')->widget(EasyAutocomplete::className(), [
    'pluginOptions' => [
        'url' => Url::to('data/countries.json'),
        'getValue' => 'name'
        'list' => [
            'maxNumberOfElements' => 10,
            'match' => [
                'enabled' => true,
                'method' => new JsExpression(<<<JavaScript
                    function(element, phrase) {

                        var searches = phrase.split(' ')
                        var count = 0;

                        for (var search of searches) {
                            if (element.search(search) > -1) {
                                count++;
                            }
                        }

                        return searches.length === count
                    }
                JavaScript
                )
            ]
        ]
    ]
]);

The Versions

16/11 2017

dev-master

9999999-dev https://github.com/gitrequests/yii2-widget-easyautocomplete

Yii2 widget for the EasyAutocomplete plugin (https://github.com/pawelczak/EasyAutocomplete).

  Sources   Download

MIT

The Requires

 

plugin extension yii2 jquery form widget autocomplete dropdown

25/10 2017

v1.0

1.0.0.0 https://github.com/gitrequests/yii2-widget-easyautocomplete

Yii2 widget for the EasyAutocomplete plugin (https://github.com/pawelczak/EasyAutocomplete).

  Sources   Download

MIT

The Requires

 

plugin extension yii2 jquery form widget autocomplete dropdown