Login Register

adding Icon in combo box or list widget

A bit more info would be helpfull

Should I rememeber correctly, in general this is done via css classes assigned to the respective objects.

Sth like

<style type="text/css">
.myIconClass {
    background-image: url {my/image/path.png};
    background-repeat: no-repeat;
    width: 16px; # my/image/path.png's width
    height: 16px; # my/image/path.png's height
    text-align: center;
}
</style>
[...]

<div id="myButton" dojoType="dijit.form.Button" iconClass="myIconClass">myButton</div>
[...]

How about posting some snippets of code you already have. Maybe I can help you better then.

if i understand what you're

if i understand what you're trying to do, you can find something about it at http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/form-validation-s...

in the demo, the comboBox reads from a store that is just a text file called states.txt.

<body class="tundra">
        <div dojoType="dojo.data.ItemFileReadStore" jsId="stateStore"
              url="states.txt">
</div>
             
     <input dojoType="dijit.form.ComboBox"
                store="stateStore"
                value="California"
                searchAttr="name"
                name="state2"
                onChange="setVal2" />

       
</body>

if you look at the first item of states.txt you see that alabama will be displayed with an image in its label. here are just the first few lines of that file

{identifier:"abbreviation",
items: [
        {name:"Alabama", label:"<img width='97px' height='127px' src='images/Alabama.jpg'/> Alabama",abbreviation:"AL"},
        {name:"Alaska", label:"Alaska",abbreviation:"AK"},
        {name:"American Samoa", label:"American Samoa",abbreviation:"AS"},
        {name:"Arizona", label:"Arizona",abbreviation:"AZ"},