All Projects → 2amigos → yii2-multi-select-widget

2amigos / yii2-multi-select-widget

Licence: BSD-3-Clause License
Bootstrap MultiSelect and MultiSelect Listbox widgets for Yii2

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to yii2-multi-select-widget

yii2-grid-view-library
Highly enhanced GridView widget and grid components for Yii2
Stars: ✭ 57 (+26.67%)
Mutual labels:  widget, yii2, yii, 2amigos
yii2-switch-widget
Bootstrap Switch Widget for Yii2
Stars: ✭ 17 (-62.22%)
Mutual labels:  widget, yii2, 2amigos
yii2-selectize-widget
Selectize From Brian Reavis Yii2 Widget
Stars: ✭ 73 (+62.22%)
Mutual labels:  widget, yii, 2amigos
ar-variation
Variation behavior for ActiveRecord
Stars: ✭ 46 (+2.22%)
Mutual labels:  yii2, yii
yii2-time-down-counter
Widget for yii2, to start count down timer with a lot of options, This widget build dependence of timeDownCounter JS library
Stars: ✭ 15 (-66.67%)
Mutual labels:  widget, yii2
yii2-flysystem-component
The League Flysystem Library for Yii Framework
Stars: ✭ 22 (-51.11%)
Mutual labels:  yii2, 2amigos
slides
Alexander Makarov conference slides
Stars: ✭ 26 (-42.22%)
Mutual labels:  yii2, yii
yii2-facades
Facades for Yii 2
Stars: ✭ 21 (-53.33%)
Mutual labels:  yii2, yii
yii2-composer
Yii 2 composer extension
Stars: ✭ 76 (+68.89%)
Mutual labels:  yii2, yii
yii2-highcharts-widget
HighCharts Js Widget for Yii2
Stars: ✭ 40 (-11.11%)
Mutual labels:  widget, yii2
yii2-editable-widget
X-Editable Widget for Yii2
Stars: ✭ 56 (+24.44%)
Mutual labels:  widget, yii
ar-role
ActiveRecord behavior, which provides relation roles (table inheritance)
Stars: ✭ 34 (-24.44%)
Mutual labels:  yii2, yii
project-template
Yii2 Project Template
Stars: ✭ 53 (+17.78%)
Mutual labels:  yii2, yii
yii2-presenter
Yii2 View Presenter
Stars: ✭ 13 (-71.11%)
Mutual labels:  yii2, yii
yii2-faker
Yii 2 Faker extension
Stars: ✭ 99 (+120%)
Mutual labels:  yii2, yii
yii2-widget-cropbox
This widget allows crop image before upload to server and send informations about crop in JSON format.
Stars: ✭ 90 (+100%)
Mutual labels:  widget, yii2
yii2-cookiemonster
Yii extension to manage cookie warning
Stars: ✭ 16 (-64.44%)
Mutual labels:  widget, yii2
filedb
ActiveRecord for static data definitions based on files
Stars: ✭ 72 (+60%)
Mutual labels:  yii2, yii
yii2-google-analytics
Google Analytics Universal tracking widget.
Stars: ✭ 14 (-68.89%)
Mutual labels:  widget, yii2
yii2-jstree-widget
jsTree tree widget for yii2
Stars: ✭ 16 (-64.44%)
Mutual labels:  widget, yii

MultiSelect Widget for Yii2

Latest Stable Version Total Downloads Build Status Latest Unstable Version
Scrutinizer Code Quality

This library contains two of the most useful bootstrap multi-select plugins. One is the MultiSelect Bootstrap plugin from David Stutz and the other is the MultiSelect.js plugin from Loudev.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require 2amigos/yii2-multi-select-widget "*"

or add

"2amigos/yii2-multi-select-widget" : "*"

to the require section of your application's composer.json file.

Usage for MultiSelect Bootstrap Plugin

Bootstrap multiselect plugin

Using a model

use dosamigos\multiselect\MultiSelect;

<?= $form->field($model, 'attribute')->widget(MultiSelect::className(),[
    'data' => ['super', 'natural'],
]) ?>

Using it as standalone widget

echo MultiSelect::widget([
    'id'=>"multiXX",
    "options" => ['multiple'=>"multiple"], // for the actual multiselect
    'data' => [ 0 => 'super', 2 => 'natural'], // data as array
    'value' => [ 0, 2], // if preselected
    'name' => 'multti', // name for the form
    "clientOptions" => 
        [
            "includeSelectAllOption" => true,
            'numberDisplayed' => 2
        ], 
]);

Usage for MultiSelectListBox Bootstrap Plugin

Bootstrap multiselect plugin

The functionality to use this plugin is actually the same as its an extension of the previous one. The only thing that changes its use is its set of configuration options.

use dosamigos\multiselect\MultiSelectListBox;
use yii\web\JsExpression;

<?= $form->field($model, 'attribute')->widget(MultiSelectListBox::className(),[
    'data' => ['super', 'natural'],
    'clientOptions' => [
        'selectableHeader' => "<input type='text' class='search-input' autocomplete='off' placeholder='try \"12\"'>",
        // yep, events MUST use JsExpression
        'afterInit' => new JsExpression('function(ms){ // ... }')
    ]
]) ?>

Further Information

I highly recommend you to visit both sites:

Then, check what are the options that would allow you to create one or the other. I have never used both on the same UI and I am not sure whether they can be used together or not. The MultiSelectListBox has a different constructor function name but very similar (multiSelect vs multiselect), but we are not sure whether they are compatible or not.

If you have the experience and willing to share, let us know on the issues and we will update this README file accordingly.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The BSD License (BSD). Please see License File for more information.

2amigOS!
Web development has never been so fun! www.2amigos.us

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].