This is a migrated thread and some comments may be shown as answers.

Custom properties for resources dataSource to bind in groupHeaderTemplate

3 Answers 273 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Andrea
Top achievements
Rank 1
Andrea asked on 27 Jan 2015, 08:59 AM
Hi,

I'm using KendoUI Scheduler and I'm grouping the events by "owner". The entity "owner" has got properties like:

{
  name: 'Andrea',
  id: '1',
  pictureUrl: 'http://someurl.com/someresource'
}


I tried to inject a groupHeaderTemplate like this:

<script id="groupHeaderTemplate" type="text/x-kendo-template">
    <strong style="color: red">#=text#</strong>
    <img src="#= image#" alt="person" height="50" />
</script>


... initializing the scheduler like this:

$(".scheduler").kendoScheduler({
    .
    .
    .
    resources: [
        {
            field: "owners",
            name: "Owners",
            dataSource: [
                { text: myOwners[0].name, value: myOwners[0].id, image: myOwners[0].pictureUrl},
                { text: myOwners[1].name, value: myOwners[1].id, image: myOwners[1].pictureUrl},
                { text: myOwners[2].name, value: myOwners[2].id, image: myOwners[2].pictureUrl}
            ],
            multiple: true,
            title: "Owners"
        }
    ]
 });


Unforunately I get the error:
Uncaught ReferenceError: image is not defined

I've been looking around within the documentation but I didn't find a way to customize the model of the resources schema.
Am I missing something or is it actually impossible to achieve what I'm trying?

Thanks for the support!
Andrea









3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 29 Jan 2015, 07:58 AM
Hello Andrea,

Currently to the "groupHeaderTemplate" are passed only the following fields:
  • color - dataColorField value
  • field - field from the event which used to match the resource
  • name - name of the resource
  • text - dataTextField value
  • title - title of the resource
  • value - dataValueField value

If you need to access additional fields of the resource you should get the scheduler object, find the needed resource object using the "name" field and search it's dataSource to find the needed resource by id (value).

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Alexander
Top achievements
Rank 1
answered on 16 Jul 2016, 07:49 AM

Is it still the same? Looks like a missing of a really helpful feature.

0
Vladimir Iliev
Telerik team
answered on 18 Jul 2016, 06:44 AM
Hi Alex,

This is still not supported out of the box, however you can find working example of finding the needed resource in the following forum post:

Regards,
Vladimir Iliev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Scheduler
Asked by
Andrea
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Alexander
Top achievements
Rank 1
Share this question
or