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

Setting colors for events

3 Answers 239 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jazeel
Top achievements
Rank 1
Jazeel asked on 12 Mar 2015, 12:06 PM
Hi,

We need to set different colors for different events based upon a status value (Approve/Reject) dynamically.
We tried the sample on your site. 
.Resources(resource =>
{
resource.Add(m => m.OwnerID)
.Title("Owner")
.DataTextField("Text")
.DataValueField("Value")
.DataColorField("Color")
.BindTo(new[] {
new { Text = "Alex", Value = 1, Color = "#f8a398" } ,
new { Text = "Bob", Value = 2, Color = "#51a0ed" } ,
new { Text = "Charlie", Value = 3, Color = "#56ca85" }
});
})
But our requirement is to load datasource for resource dynamically with StatusId and StatusColor.

Thanks,
Jazeel

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 13 Mar 2015, 09:33 AM
Hello Jazeel,

Please note that the "Resources" of the Scheduler support configuring regular DataSource (the same way as the Scheduler) for loading data from remote source:

.Resources(resource =>
{
    resource.Add(m => m.OwnerID)
        .Title("Owner")
        .DataTextField("Text")
        .DataValueField("Value")
        .DataColorField("Color")
        .DataSource(ds => ds
            .Read("ReadOwners", "Home"));

Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jazeel
Top achievements
Rank 1
answered on 19 Mar 2015, 08:42 AM
Hi Vladimir,

Thanks it worked.

Is there any option to set the font color for events dynamically?
Is there any option to select date using javascript?

Thanks & Regards,
Jazeel
0
Vladimir Iliev
Telerik team
answered on 19 Mar 2015, 09:48 AM
Hi Jazeel,

Straight to your questions:

1) You can define custom "EventTemplate" (using Kendo UI templates) to customize the look of the events.
2) If you need to change the date you can use the Scheduler "date" method:


Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Scheduler
Asked by
Jazeel
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Jazeel
Top achievements
Rank 1
Share this question
or