Yii 1.1: optiontransferselect

option transfer between two list box
6 followers

This extension is used to transfer options between two select filed.

Resources

Documentation

Requirements

  • Yii 1.0 or above

Installation

  • Extract the release file under protected/extensions

Usage

See the following code example:

$this->widget('application.extensions.optiontransferselect.Optiontransferselect',array(
     'leftTitle'=>'label1',
     'rightTitle'=>'label2',
     'name'=>'Model[ids][]',
     'list'=>$leftOption,
     'doubleList'=>$rightOption,
     'doubleName'=>'Model[ids2][]'));

$leftOption and $rightOption like the following: $leftOption =array(array('id1'=>'name1'),array('id2'=>'name2')); $rightOption =array(array('id3'=>'name3'),array('id4'=>'name4'),array('id4'=>'name4'),array('id5'=>'name5'));

If you think that can, please make a rating, has been encouraging to me

Change Log

March 31, 2009

  • Initial release.
  • List and doubleList property suport (value=>display) data.
  • Add Optiontransferselect.php doc comment.

Total 7 comments

#14779 report it
martijnjonkers at 2013/09/09 06:08am
jquery error

I encountered an error when i wanted to use this extension. On it own it works fine, but i used another widget wich also used jquery. It conflicted.

I noticed you didn't use the core script for jquery. I changed registerClientScript to

protected function registerClientScript(){
  $file=dirname(__FILE__).DIRECTORY_SEPARATOR.'jquery.multiselects.js';
  $jsFile=Yii::app()->getAssetManager()->publish($file);
  $cs=Yii::app()->clientScript;
 
  $cs->registerCoreScript('jquery');
  $cs->registerScriptFile($jsFile, CClientScript::POS_HEAD);
}

Now it didn't conflict anymore and it works perfectly!

#4736 report it
Fan_Of_Yii at 2011/08/09 09:12pm
Populating Source list dynamically based on other drop down box selection

Thanks a lot for this wonderful extension . I am new to this filed and got a question .

I have

<?php echo CHtml::dropDownList("cars", '',CHtml::listData(MasterCars::model()->findAll(),'cars_code','cars_name'),array('size'=>20) );?>

based on the above drop down selection , I want to populate Source drop down in the below widget . I mean in the below widget code want to pass the above selected code in the "findAll" method .

Could you please advise thanks for your help ?

<?php
         $this->widget('application.extensions.optiontransferselect.Optiontransferselect',array(
              'leftTitle'=>'Cars Available',
              'rightTitle'=>'Cars Selected',
              'name'=>'Model[ids][]',
              'list'=>CHtml::listData(MasterModels::model()->findAll('X'),'model_code','model_name'),
              'doubleList'=>array(),
              'doubleName'=>'Model[ids2][]'));
        ?>
#2892 report it
PinkBrainPlan at 2011/02/23 01:59am
Question

Hi, I really like this extension, it's simple and delivers full functionallity! As I have a special issue, I would like to know, if this is possible;)

I have a teams=array() and a relation table tournament, team, competition so -> while I add a team to the "selected" list, I need to pass the additional parameters tournament and competition... (stored in input-fields...) How can I do this?

Thx a lot! Phil

#578 report it
fastcrash at 2010/04/20 04:11am
Defintlt is it

this is what i need, thanx.

#1639 report it
rodzadra at 2009/05/28 03:16pm
How (or where) to create a callback function?

Hi sharehua,

Tank you for your reply.

I believe that callback function need to be writed in javascript, isn't it?

So can you give me a light, on how to do that?

Thank you again.

Correction: skinnabled

#1686 report it
sharehua at 2009/05/10 07:32am
limit on how many options

You can add beforemove callback function at echo '$("#select_right").multiSelect("#select_left", {trigger: "#options_left",trigger_up: "#options_right_up", trigger_down: "#options_right_down", keepSelected:false});'; of the Optiontransferselect.php file to caculate that if can move options.

#1688 report it
rodzadra at 2009/05/09 05:44pm
Simple, but works.

That's it.

Can you put a, optional, limit on how many options can be transfered to the right size?

Can you make this skynnabled?

Thank you.

Leave a comment

Please to leave your comment.

Create extension