Kendo UI dropdown list - different background color to each list item -


how provide different background colors each list item (non-selected) in kendo ui dropdown list rather giving common background color whole dropdown?

you should defined template sets appropriate color.

example:

define datasource as:

var colors = [     "red",     "green",     "pink",     "blue",     "yellow" ]; 

and template as:

<script id="template" type="text/kendo-script">     <div style="background-color: #= data #">#= data #</div> </script> 

then dropdownlist definition should as:

var template = kendo.template($("#template").html()) $("#dropdownlist").kendodropdownlist({     datasource: colors,     template : template }); 

working example here: http://jsfiddle.net/onabai/mzlrs/


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -