2017 © Pedro Peláez
 

yii2-extension yii2-simple-dual-listbox

Simple Dual Listbox

image

edwinhaq/yii2-simple-dual-listbox

Simple Dual Listbox

  • Friday, March 23, 2018
  • by edwinhaq
  • Repository
  • 3 Watchers
  • 4 Stars
  • 138 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 19 % Grown

The README.md

yii2-simple-dual-listbox

Simple dual listbox for Yii framework 2.0 or later, (*1)

Description

edwinhaq\simpleduallistbox\SimpleDualListbox widget is a simple way to control listbox items, (*2)

Requirements

  • Yii Version 2.0.0 or later

Installation

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

Either run, (*4)

php composer.phar require --prefer-dist edwinhaq/yii2-simple-dual-listbox "*"

or add, (*5)

"edwinhaq/yii2-simple-dual-listbox": "*"

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

Usage

Once the extension is installed, simply use it in your code by :, (*7)


use edwinhaq\simpleduallistbox\SimpleDualListbox; // ... Form definition $items = ['1' => 'Item1', '2' => 'Item2', '3' => 'Item3',]; $options = []; $options['size'] = 10; $options['style'] = 'width:200px'; $options['options'] = []; // If 'title' not defined SimpleDualListbox defines it for each option item $clientOptions = []; $clientOptions['availableListboxPosition'] = "left"; // options: left (default), right $clientOptions['availableListSort'] = SimpleDualListbox::$SORT_NUM_ASC; $clientOptions['upButtonText'] = "UP"; $clientOptions['addButtonText'] = "ADD"; $clientOptions['addAllButtonText'] = "ADDALL"; $clientOptions['remAllButtonText'] = "REMALL"; $clientOptions['remButtonText'] = "REM"; $clientOptions['downButtonText'] = "DOWN"; $clientOptions['selectedLabel'] = "Selected"; $clientOptions['availableLabel'] = "Available"; $widgetOptions = []; $widgetOptions['label'] = 'InputLabel'; // Ignored when model is used $widgetOptions['name'] = 'InputName'; // Ignored when model is used $widgetOptions['hint'] = 'Hint'; // Ignored when model is used $widgetOptions['selection'] = [1,2]; // Ignored when model is used $widgetOptions['id'] = 'Input ID'; // Optional $widgetOptions['template'] = '{label}{listbox}{hint}'; // Used to generate element, by default '{label}{listbox}{hint}' $widgetOptions['useGroupDiv'] = true; // true by default. Wrap element in a div tag: <div class="form-group"> ... </div>, $widgetOptions['items'] = $items; $widgetOptions['options'] = $options; $widgetOptions['clientOptions'] = $clientOptions; /* * With model */ $model->attribute = [1,2]; $field = $form->field($model, 'attribute')->widget(SimpleDualListbox::className(), $widgetOptions); /* * Without model */ echo SimpleDualListbox::widget($widgetOptions); // ... End form definition

History

  • Version 1.0.0 (2017-05-28)
    • Tested on Yii 2.0.6
  • Version 1.0.1 (2017-10-31)
    • Tested on Yii 2.0.12
  • Version 1.0.2 (2018-02-28)
    • Tested on Yii 2.0.13.1
  • Version 1.0.3 (2018-03-22)
    • Tested on Yii 2.0.15.1

The Versions

23/03 2018

dev-master

9999999-dev

Simple Dual Listbox

  Sources   Download

MIT

The Requires

 

extension yii2 listbox dual-listbox

23/03 2018

1.0.3

1.0.3.0

Simple Dual Listbox

  Sources   Download

MIT

The Requires

 

extension yii2 listbox dual-listbox

02/03 2018

1.0.2

1.0.2.0

Simple Dual Listbox

  Sources   Download

MIT

The Requires

 

extension yii2 listbox dual-listbox

31/10 2017

1.0.1

1.0.1.0

Simple Dual Listbox

  Sources   Download

MIT

The Requires

 

extension yii2 listbox dual-listbox

16/06 2017

1.0.0

1.0.0.0

Simple Dual Listbox

  Sources   Download

MIT

The Requires

 

extension yii2 listbox dual-listbox