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.
Defintlt is it
this is what i need, thanx.
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
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.
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.
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
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][]')); ?>
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!
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.