hi,
I am new to this framework, and i want to have checkboxlist combined with dropdownlist and i could’nt do it, please does someone have eny idea !! :s
i want to have my dropdownlist with the possibility to select many fields
thanks
regards
hi,
I am new to this framework, and i want to have checkboxlist combined with dropdownlist and i could’nt do it, please does someone have eny idea !! :s
i want to have my dropdownlist with the possibility to select many fields
thanks
regards
You can use this extension to do that: http://www.yiiframework.com/extension/echosen I am using it and it is really straight forward. It is a wrapper for the Chosen JQuery Plugin (http://harvesthq.github.com/chosen/)
thank you Haensel for this extension i’ve tried it but it does’nt show anything
<?php $this->widget( 'ext.EChosen.EChosen', array(
'target' => 'select',
'useJQuery' => false,
'debug' => true,
)); ?>
do you know what should i do please
Simply create a checkboxlist somewhere in your view and place the above code in the same view. The code only transforms a checkboxlist but doesn’t create one for you.
use this link…i solved the same by using this.
http://code.google.com/p/dropdown-check-list/
in your layout main.php
[b]
paste this with [/b]
<link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->request->baseUrl; ?>/css/jquery-ui-1.8.13.custom.css" />
<link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->request->baseUrl; ?>/css/ui.dropdownchecklist.themeroller.css" />
<?php
$cs = Yii::app()->clientScript;
$cs->scriptMap = array(
'jquery.js' => Yii::app()->request->baseUrl . '/js/jquery-1.6.1.min.js',
'jquery-ui-1.8.13.custom.min.js' => Yii::app()->request->baseUrl . '/js/jquery-ui-1.8.13.custom.min.js',
);
$cs->registerScriptFile('jquery-ui-1.8.13.custom.min.js');
?>
<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . '/js/ui.dropdownchecklist-1.4-min.js'); ?>
then
in your root directory
put these files with in the directory(js,css,src)
1:…js/ui.dropdownchecklist-1.4-min.js
2:…/js/jquery-ui-1.8.13.custom.min.js
3:…/css/ui.dropdownchecklist.themeroller.css
4:…/css/jquery-ui-1.8.13.custom.css
5:…/js/jquery-1.6.1.min.js
Make sure to have your array(‘multiple’=>‘multiple’)
in dropDownList form element.
and in _form.php
use this
<script type="text/javascript">
var $storeDir1 = jQuery.noConflict();
$storeDir1(function(){
$storeDir1('#Modelname_DropdownlistId').dropdownchecklist({icon: {},maxDropHeight: 150,Width:100, emptyText: "Select"});
});
use your model name and dropdownlist id
Modelname_DropdownlistId
these are directory with file name.should be in root directory
Hope will solve your problem.
reply if ur getting any problem
Best wishes.