2017 © Pedro Peláez
 

yii2-extension yii2-multi-select-widget

Multiselect Bootstrap widget for Yii2.

image

2amigos/yii2-multi-select-widget

Multiselect Bootstrap widget for Yii2.

  • Wednesday, February 7, 2018
  • by tonydspaniard
  • Repository
  • 14 Watchers
  • 33 Stars
  • 45,034 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 20 Forks
  • 4 Open issues
  • 4 Versions
  • 6 % Grown

The README.md

MultiSelect Widget for Yii2

Latest Stable Version Total Downloads Build Status Latest Unstable Version
Scrutinizer Code Quality, (*1)

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., (*2)

Installation

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

Either run, (*4)

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

or add, (*5)

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

to the require section of your application's composer.json file., (*6)

Usage for MultiSelect Bootstrap Plugin

Bootstrap multiselect plugin, (*7)

Using a model, (*8)

use dosamigos\multiselect\MultiSelect;

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

Using it as standalone widget, (*9)

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, (*10)

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., (*11)

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

= $form->field($model, 'attribute')->widget(MultiSelectListBox::className(),[
    'data' => ['super', 'natural'],
    'clientOptions' => [
        'selectableHeader' => "",
        // yep, events MUST use JsExpression
        'afterInit' => new JsExpression('function(ms){ // ... }')
    ]
]) ?>

Further Information

I highly recommend you to visit both sites:, (*12)

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., (*13)

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

Contributing

Please see CONTRIBUTING for details., (*15)

Credits

License

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

2amigOS!
Web development has never been so fun! www.2amigos.us, (*17)

The Versions

07/02 2018

dev-master

9999999-dev https://github.com/2amigos/yii2-multi-select-widget

Multiselect Bootstrap widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii widget multiselect

10/12 2017

1.0.0

1.0.0.0 https://github.com/2amigos/yii2-multi-select-widget

Multiselect Bootstrap widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii widget multiselect

10/05 2014

0.1.1

0.1.1.0

Multiselect Bootstrap widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii widget multiselect

17/01 2014

0.1.0

0.1.0.0

Multiselect Bootstrap widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii widget multiselect