jmultiselect2side Extension for multiselect2side plugin

  1. Requirements
  2. Installation
  3. Usage
  4. Version log
  5. Resources

Extension for multiselect2side plugin (transfer select).

Requirements

  • Yii 1.1 or above

Installation

  • Extract the release file under protected/extensions

Usage

Example 1.-

<?php
                $this->widget('application.extensions.jmultiselect2side.Jmultiselect2side',array(
                    'name'=>'Model[]',
                    'labelsx'=>'Disponible',
                    'labeldx'=>'Seleccionado',
                    'moveOptions'=>false,
                  'list'=>array('id1'=>'name1','id2'=>'name2') ,
             ));
         ?>

Example 2.- Another example using AR data:

// we have groups and user belonging to groups. (relation in Group model called userList ) Updating group with id==1 :

$model= Group::model()->findByAttributes(array('id'=>'1') );
// complete user list to be shown at multiselect order by username
$users= User::model()->findAll(
                 array('order' => 'username'));

.....

$this->render('update',array(
			'model'=>$model,
                        'users'=>$users,
));

 

At the view we generate the multiselect using $model:

<?php
                $this->widget('application.extensions.jmultiselect2side.Jmultiselect2side',array(
                    'model'=>$model,
                    'attribute'=>'userList', //selected items
                    'labelsx'=>'Disponible',
                    'labeldx'=>'Seleccionado',
                    'moveOptions'=>false,
                    'autoSort'=>'true',
                    'search' =>'Filtro:',
                  'list'=>CHtml::listData(             // available items
                       $users,
                       'id',
                       'username'),

             ));
         ?>

Valid options are:

* selectedPosition - position of selected elements - default 'right'
* moveOptions - show move options - default true
* labelTop - label of top buttom - default 'Top'
* labelBottom - label of bottom buttom - default 'Bottom'
* labelUp - label of up buttom - default 'Up'
* labelDown - label of down buttom - default 'Down'
* labelSort - label of sort buttom - default 'Sort'
* maxSelected - number of max selectable options
* labelsx: Left label - default '* Selected *'
* labeldx: Right label - default '* Available *'
* autoSort: Automatic sort of selected options - default true
* search: Filter/Search

Version log

1.4 Parameter search added.

Resources

Demo

5 0
23 followers
1 412 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Developed by: rparra
Created on: Feb 22, 2011
Last updated: 7 years ago

Downloads

show all

Related Extensions