2017 © Pedro Peláez
 

widget yii2-search-select

Search Select Widget for Yii2

image

gooverdian/yii2-search-select

Search Select Widget for Yii2

  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

yii2-search-select

Search Select Widget for Yii2, (*1)

Installation

You can install this widget using composer, (*2)

php composer.phar require gooverdian/yii2-search-select "*"

or add the following line to the require section of your composer.json file and run php composer.phar update, (*3)

Usage

Add use gooverdian/sSelect/SearchSelect; to the use section of your view file and then add, (*4)

echo $form->field($model, 'attribute')->widget(SearchSelect::class, [
    'clientOptions' => [
        'items' => [
            'value1' => 'Name 1',
            'value2' => 'Name 2',
        ],
    ],
]);

somewhere in the body. This will create simplest form of the widget., (*5)

You can exchange items property with url, so that every change in widget input will send a request waiting dynamic JSON data consisting of something similar to items in response. Entered data will be passed in query parameter of GET request., (*6)

You can also use this widget standalone, without ActiveField, but you must specify name attribute in this case:, (*7)

echo SearchSelect::widget([
    'name' => 'inputName',
    'clientOptions' => [
        'url' => '/some/api/url',
    ],
]);

WIP, (*8)

The Versions

11/05 2018

dev-master

9999999-dev https://github.com/gooverdian/yii2-search-select

Search Select Widget for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 search widget select