2017 © Pedro Peláez
 

library yii2-select3

a specialized jquery based DropDownList component displaying checkboxes as options.

image

freesoftwarefactory/yii2-select3

a specialized jquery based DropDownList component displaying checkboxes as options.

  • Thursday, October 12, 2017
  • by christiansalazar
  • Repository
  • 3 Watchers
  • 4 Stars
  • 50 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 11 Versions
  • 6 % Grown

The README.md

Select3 (yii2-select3)

Display a hybrid between a DropDownList and a Multi-selectable checkboxes., (*1)

platform: Yii Framework 2.0, (*2)

author: Cristian Salazar chileshift.cl/freesoftwarefactory, (*3)

Preview

Preview, (*4)

Usage

  1. Via composer,
"require": {
    "php": ">=5.4.0",
    "freesoftwarefactory/yii2-select3": "(put version here)"
},
  1. In your View
 "Chevrolet",
    'opt2' => "Mazda",
    'opt3' => "Audi",
];



?>

'form1', ]); ?>



=$form->field($model, 'someAttributeInYourModel') ->widget(Select3Widget::className(), [ 'prompt' => 'Select Provider', 'options' => $options, 'allSelectable' => true, 'allSelectableLabel' => "(All)", 'visibleAtStartup' => false, ]) ?>

Receving Values from this Control

Values are base64+json encoded, that is, when you submits a form using this control then you will have something similar to:, (*5)

eyJvcHQxIjp0cnVlLCJvcHQyIjp0cnVlLCJvcHQzIjpmYWxzZX0=

Which is a base64 encoded version of this:, (*6)

 {"opt1":true,"opt2":true,"opt3":false}

So, you can just call:, (*7)

$values = json_decode(base64_decode($model->yourAttribute),true);

Or... just call :), (*8)

$values =  Select3Widget::getDecodedValueFrom($model, 'yourAttribute');

More functions

  1. load items via javascript by calling:
$.fn.select3load($('#widgetid') , { 123 : some , 456 : thing });
  1. Disable the control by passing:
[
    'disable'=>true,
]
  1. Disable/Check some items at startup by calling
[
    'disabledOptions' => ['somekeydisabled'],

    'autoSelectOptions' => ['somekeySelectedFromTheBeginning'],
]
  1. Javascript events to listen for changes
$this->registerJs("
    $(document).on('select3-changed', [], function(e, options, widget){
        console.log('select3-changed', options, widget);     
    });
");

The Versions

12/10 2017

dev-master

9999999-dev http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3

12/10 2017

1.0007

1.0007.0.0 http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3

10/10 2017

1.0006

1.0006.0.0 http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3

10/10 2017

1.0005

1.0005.0.0 http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3

10/10 2017

1.0004

1.0004.0.0 http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3

07/10 2017

1.0003

1.0003.0.0 http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3

07/10 2017

1.0002

1.0002.0.0 http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3

07/10 2017

1.0001

1.0001.0.0 http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3

07/10 2017

1.0000

1.0000.0.0 http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3

07/10 2017

0.0002

0.0002.0.0 http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3

07/10 2017

0.0001

0.0001.0.0 http://github.com/freesoftwarefactory/select3/wiki

a specialized jquery based DropDownList component displaying checkboxes as options.

  Sources   Download

GPL-3.0

yii2 dropdownlist widgets select3