:: Forum >>

how to implement a color picker combo?

i want see if i can use the combo control to implement a color picker. it would have a handful of the "standard" colors such as black, blue, red, gray, green, purple, with either the text in that color, or a color box next to the text.

since i have only a few colors i don't need those fancy palette or slider stuff.

i don't really want to create separate .gif or .jpg for each color. it will not be used inside the grid widget.

thanks for any help!
Wednesday, August 9, 2006
You can use css to make colored boxes (without .gif images) -


.aw-image-black {background-color: #000000;}
.aw-image-blue {background-color: #0000FF;}
.aw-image-green {background-color: #00FF00;}
.aw-image-red {background-color: #FF0000;}
.aw-image-yellow {background-color: #FFFF00;}
.aw-image-white {background-color: #FFFFFF;}

#myColors .aw-item-image, #myColors-popup .aw-item-image {
    border: 3px solid #fff;


    var colorsText = ["Black", "Blue", "Green", "Red", "Yellow", "White"];
    var colorsImage = ["black", "blue", "green", "red", "yellow", "white"];

    var obj = new AW.UI.Combo;

    // update textbox image
    obj.onSelectedItemsChanged = function(items){

Alex (ActiveWidgets)
Thursday, August 10, 2006
works perfectly! looks REALLY nice! thank you alex!
Thursday, August 10, 2006

This topic is archived.

Back to support forum

Forum search