I assume that the same problem exists when you define the width via ‘width:450px’ instead of span-10?
It seems to me, that there are other style-declarations (like width, or float:right etc.) that affect the checkboxes and make them appear that way…
Do you use Firebug (the add-on for firefox)?
With firebug you could determine what styles exactly are applied to the checkboxes.
Sometime css-styles do behave unexpectedly and if there are more than one css-file, something overrides the other and there is no way to know what happpens without some tool like firebug…
It is really difficult to say something without seeing the code, but I have the suspicion that somewhere in your css files there is a style declaration for the ‘label’ element that sets a fixed width for it and makes the text within right aligend, i.e. something like this:
label {
width:100px;
text-align:right;
}
This is often done to style form elements, where a label is followed by a text-field for example, to produce forms like here: http://jeffhowden.com/code/css/forms/
Note that the labels are right aligned and how they are styled further below:
I want to display it like a multiple checkbox list but without the user to click on the scroller => always display the entire list (and abusing : is it possible in that case that the checkboxes take the entire height before the next component? - css? my weakness)
I’m afraid I don’t know an easy way to tweak EchMultiSelect like you want… apart from trial-error…
I have a few ideas, but I don’t know if they would work properly:
With the ‘autoOpen’ set to true, you can make the checkboxes appear on page load
If you comment out the ‘close’ function in the js-file (jquery.multiselect.js), the displayed checkbox container then would never close.
with the ‘height’ option you could fix the height (for example 500px;)
To make sure the the checkbox container is not positioned over other elements, you could put the EchMultiSelect widget into a div with the style="height:550x; display:block;" (adjust height to the height of the container)
I am always getting only one values even though i have selected multiple of data.If i use dropDownAttribute instead of name ,then it works but if I want to update it doesn’t work with dropDownAttribute but shows the value while using name. So i want to use name instead of dropDownAttribute in EchMultiselect,but the problem is it doesn’t save the multiple selected value
But generally speaking, to use the ‘name’ attribute and save the selected values, your view fiel should look like (I use the example from the extension page):
This will produce a dropdown list of the six colors.
‘red’ and ‘black’ will be preselected (because declared in ‘value’ attribute).
In your controller actionUpdate, $_POST[‘colors’] will be an array that contains the keys of the selected colors. If for example yellow, green and blue are selected before update, then $_POST[‘colors’] will be:
$_POST['colors'] = array(1, 4, 5);
Note that you have to save these selected values manually where you want to have them saved. That will not happen automatically!
In this example I could have a table ‘obj_color’, in which I want to store the selected colors for an object with the id $obj_id. I would have to save these values in the Update action like so:
foreach($_POST['colors'] as $color_id) {
$ocolor = new ObjColor;
$ocolor->obj_id = $obj_id;
$ocolor->color_id = $color_id;
$ocolor->save();
}
In any case, you will have to use a foreach-loop in your controller to loop through the selected values and process/save them.
Thanks for this widget as it was prefect for what I was looking for, but the download from the extension page (link provided on the first post) has a bug in the jquery.multiselect.js when it is loaded with jquery 1.8.0. The bug is that the show and hide functions are incorrectly phrased and causing a TypeError by stating .easing function in jquery does not exist.
In the multiselect.js file these functions that are causing this error are .hide(effect, speed) and .show(effect, speed). These should be phrased as .hide(speed, effect) and .show(speed, effect).
Just a note to all that if you use this with jquery 1.8.0 either repair these functions or download the latest multiselect.js source from the link provided in the first post.
I would provide the links in this post but this website will not let me
this reply is quite late and you probably solved your problem by now, but just in case:
I just uploaded a new version, which can be used as a filter in CGridview with just an additional option.
I also added an example to the extension page.
Sorry for the late reply. I didn’t know an answer right away and didn’t have the time to experiment. Today jeremy provided a solution for this (see his comments on the extension page), which I promptly added to the extension.
Does this extension still work? I’ve tried to add it as a filter in a CGridView but I had several problems. The first I could solve by the advice of this post Now the widgets opens and closes but still the filter results aren’t shown in the grid. In the console I see the request for the filtered list (which is the correct one) but the result is just not shown in the table.