Style dijit.form.Select drop down menu -
how can style dijit.form.select
drop down menu if use html markup.
<select id="sourceselect" dojotype="dijit.form.select" style='width:200px' onchange="changedetected();"> </select>
to make clear want style drop down menu filled content. want change height of menu , have scroll bar if height exceeded.
i using dojo version 1.6. here fiddle example: http://jsfiddle.net/nh7dd/.
edit: why minuses?
the menu generated dojo placed in root of dom node. it's common mistake menu somehow relative positioned towards textfield, isn't.
if wish change style of menu, use following css selector:
div[dijitpopupparent="sourceselect"] > .dijitmenu { /** css */ }
the reason works because menu wrapped inside dijit/popup
. popup allows displaying/hiding menu , can see has attribute dijitpopupparent
has original id of field.
i updated jsfiddle, looks this. don't recommend changing behavior of menu this, since might mess original functionality/behavior of combobox. mean, right have problems going values because 1 "scroll tick" passes value. updated style can't select "2" anymore.
edit: in updated jsfiddle scrollbar visible, if want scrollbar appear when there more options, change overflow-y: scroll
overflow-y: auto
.
Comments
Post a Comment