Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Background color of events in the schedule view

$
0
0
Let's say I have some data like this:

dataSource: [
            {
                title: "Test",
                start: newDate("2015/6/13 6:00"),
                end: newDate("2015/6/13 7:30"),
                availableServices: [1]
            }
        ],
        resources: [
            {
                field: "availableServices",
                title: "Available Services",
                dataSource: [
                    { value: 1, text: "On Demand", color: "#e6f1df"},
                    { value: 2, text: "Patient Scheduled", color: "#f1e2ed"},
                    { value: 3, text: "Admin Scheduled", color: "#fef1de"},
                    { value: 4, text: "Unavailable/Blocked", color: "#c6c3c3"}
                ],
                multiple: true
            }
        ]

How do I then reference that in a custom template? I'm trying this but it's not working:

<scriptid="block-template"type="text/x-kendo-template">
    <divclass="event-block  #if(availableServices=='On Demand'){# on-demand #}else{# meep #}#">
        <p>
            #: kendo.toString(start, "hh:mm") # - #: kendo.toString(end, "hh:mm") #
        </p>
        <span>
            #: title #
        </span>
        <span>
            #: availableServices #
        </span>

 

The class name doesn't show up in the containing div, and the #: availableServices # part in the event window is output as "[object Object]"


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>