I have many igCombo, each needs to have the selected item background color different from another, so nothing to change JS.
I would like to just tie the id of the div interested by igCombo with the class of the igCombo "ui-state-active" but because the list of items is generated elsewhere I can't do this.
Any tip on how to achieve this?
Indeed a better solution that I had not think of !
Thanks for sharing it in the Infragistics community !
I reviewed the jsfiddle and I achieved in the end a simpler solution:
- set dropDownAttachedToBody: false- add css styling like #dropDownComboBox .ui-state-active {}
It's far less fuss with js and more directly styling colors
ps: in the jsfiddles in some browsers http scripts links don't work anymore(maybe because unsafe), just had to add "s" and the libraries loaded
Hi Eugenio,
Currently the dropdown lists are not differentiated by id or class. They are exactly the same for each combo on the page, and each combo widget has a reference to its own list.
Therefore so you will need to add id/class to every list:
$("#autoCompleteCombo").igCombo({ ... }).data().igCombo.dropDown().addClass("pinkColor"); $("#filterContainsCombo").igCombo({ ... }).data().igCombo.dropDown().addClass("green"); $("#caseSensitiveCombo").igCombo({ ... }).data().igCombo.dropDown().addClass("yellow");
in order to query them using CSS selectors:
.pinkColor .ui-igcombo-listitemholder li.ui-state-active { background-color: pink; } .green .ui-igcombo-listitemholder li.ui-state-active { background-color: green; } .yellow .ui-igcombo-listitemholder li.ui-state-active { background-color: yellow; }
Please review the jsfiddle that I have prepared for you and let me know if you have further questions, I will be glad to help.