Search code examples
comboboxzkzul

Changing the colour of a combobox in ZK


Hi I am a novice in ZK and I would like to change the selected cell of a combobox from light blue, the standard colour, to green. I have been looking for online resources but somehow I couldn't fine anything. Any tips? Thanks in advance!


Solution

  • Changing colors in ZK is done by apply/override css to the element.
    The css class your looking for is .z-comboitem:hover.
    Just add the following to the .zul

    <style>
    .z-comboitem:hover {
        background: /* your color here*/; 
     }
     </style>
    

    Pleas read this for more information.

    EDIT

    Sorry my answer is for changing the the hover color not the selected and the first version I refered to the wrong CSS class...
    @kachhalimbus answer should be the best, especially because he has for sure much more experience than me. So thanks to @kachhalimbu :)