Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How can i set two different colours for two different listviews in kendoui,

How can i set two different colours for two different listviews in kendoui,

Problem

I am using .css file for the styles. In my view page i am having two list views and i want two different colours for two of the list views. How can i do that in kendo ui

Regards,

Sri

Problem courtesy of: Sri

Solution

Prefix your CSS definition by listview id, discriminating between one and the other.

Given the HTML for the ListViews:

and a JavaScript:

$("#ListView1").kendoListView({
    dataSource: sharedDataSource,
    selectable: true,
    template: "
  • ${title} ${year}
  • " }); $("#ListView2").kendoListView({ dataSource: sharedDataSource, selectable: true, template: "
  • ${title} ${year}
  • " });

    The CSS definition would be something like:

    #ListView1 .k-state-selected {
        background: red;
    }
    #ListView2 .k-state-selected {
        background: blue;
    }
    
    Solution courtesy of: OnaBai

    Discussion

    View additional discussion.



    This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

    Share the post

    How can i set two different colours for two different listviews in kendoui,

    ×

    Subscribe to Css3 Recipes - The Solution To All Your Style Problems

    Get updates delivered right to your inbox!

    Thank you for your subscription

    ×