2017 © Pedro Peláez
 

yii2-extension yii2-autocomplete

yii2-autocomplete jquery ui

image

muhiddingithub/yii2-autocomplete

yii2-autocomplete jquery ui

  • Thursday, October 26, 2017
  • by mjumaniyazoff
  • Repository
  • 1 Watchers
  • 2 Stars
  • 25 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 14 % Grown

The README.md

yii2-autocomplete

yii2-autocomplete jquery ui, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require muhiddingithub/yii2-autocomplete "dev-master"

or add, (*4)

"muhiddingithub/yii2-autocomplete": "dev-master"

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

Jquery source, (*6)

Usage

    echo  \muhiddin\autocomplete\AutoComplete::widget([
                                'id' => 'search',
                                'form'=>$form, // ActiveForm widget object
                                'model'=>$model, // model
                                'attribute'=>'model_attribute', // attribute of model
                                'value' => '',
                                'name' => 'name',
                                'options' => [
                                    'class' => 'form-control form-group-margin',
                                    'dir' => "ltr",
                                    'placeholder' => "search",
                                ],
                                'pluginOptions' => [
                                    'minChars' => 3,
                                    'serviceUrl' => \yii\helpers\Url::toRoute(['custom-controlller/customer-action']),
                                    'width' => '40%',
                                    'onSelect' => 'function(suggestion){
                                        // call onselect found element function

                                    }'
                                ]
                            ])

in custom-controlller/customer-action

$query = Yii::$app->request->get('query');
        if (!empty($query)) {
            $find = MyModel::find()->andFilterWhere(['like','column_name',$query]);
            $allModels = $find->column();
            echo json_encode([
                'suggestions' => $allModels
            ]);
        } else {
            echo json_encode(['status' => 'failure']);
        }

The Versions

26/10 2017

dev-master

9999999-dev

yii2-autocomplete jquery ui

  Sources   Download

MIT

by Muxiddin Jumaniyazov

extension yii2 search widget autocomplete jquery-ui muhiddin

25/10 2017

1.0

1.0.0.0

Multiple select element

  Sources   Download

MIT

by Muxiddin Jumaniyazov

extension yii2 search widget autocomplete jquery-ui muhiddin