Search code examples
kendo-uitelerikkendo-schedulerkendo-template

Scheduler resources with aliases


You all can see Kendo Resources example there. It's very simple — you just got an array with options, which Kendo knows — color, text and then bind them by value.

Now imagine another example — we have a more complex datasource in this format:

{ status: "Busy", value: 1, url1: "/img/overlay_icon_busy.jpeg", url2: "/img/icon_busy.jpeg"}

As you can see, there's only familiar to Kendo is a value field. This source is a common for appointment template and for editor template. text and url2 we shall use for editor (hello again, Multiselect!), url1 must be used for template to show some overlay icon.

Problem is that I don't know how to bind this things as resource and make them work — I've never seen something like this. Can it be done with Kendo and how?


Update: maybe this image will help to understand what I'm trying to do. scheme


Solution

  • Solved problem using next approach. First, I've declared datasource, and then just wrapped it in method, which accepts ID. And in a template I wrote:

    <div class="pre" style="background: url(#: intToStatus(status).img #)"></div>
    

    And it works!