2017 © Pedro Peláez
 

library yii2-select2

Select2

image

apollo/yii2-select2

Select2

  • Tuesday, February 25, 2014
  • by vov4ik08
  • Repository
  • 1 Watchers
  • 1 Stars
  • 58 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

This widget for you select2 v3.4.5 (http://ivaynberg.github.io/select2/)

Usage, (*1)

/*  $form->field($model, 'users_to')->widget(\Apollo\Select2Field::className(), [

        'clientOptions' => [
            'allowClear' => true,
            'language' => 'ru',
            'maximumSelectionSize'=>'3',
            'multiple' => 'false',
            'minimumInputLength' => '3',
              'placeholder'=>"Search for a movie",
            'ajax' => [
                'url' => Yii::$app->urlManager->createUrl('URL'),
                'dataType' => 'json',
                'data' => new yii\web\JsExpression('function (term) {

                                                    return {
                                                        username: term, // search term

                                                        } ;
 }'),



                'results' => new yii\web\JsExpression('function (data) { // parse the results into the format expected by Select2.
 var myResults = [];
$.each(data, function (index, item) {
 myResults.push({
 id: item.id,
  text: item.FIO + " " + (item.login)
 });

});
                                            return {

                                              results: myResults
                                                 };
 }')


            ],

        ]

    ])

The Versions

25/02 2014

dev-master

9999999-dev http://google.com

Select2

  Sources   Download

MIT

The Requires

 

select2