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

How to customized event template base on status

3 Answers 141 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
venkata
Top achievements
Rank 1
venkata asked on 14 Jul 2016, 06:36 PM
Hi I’m we are using kendo scheduler in our project and I’m trying to develop customize   event templates base on status of event whether it is confirmed or planned or canceled 

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 18 Jul 2016, 07:30 AM
Hello,

If you need to customize the edit window based on the currently edited event than you can use the "edit" event  of the Scheduler as follows:

Regards,
Vladimir Iliev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
venkata
Top achievements
Rank 1
answered on 21 Jul 2016, 06:42 PM

Hi,

I"m using mvc how to do it in mvc ,and how can i change title and color and layout for  editable templates i do have four types base on their status 

0
Vladimir Iliev
Telerik team
answered on 22 Jul 2016, 07:22 AM
Hi Venkata,

Please check the example below of how to define the edit event of the Scheduler in MVC:


@(Html.Kendo().Scheduler<Task>()
    .Name("Scheduler")
    .Events(events => events.Edit("edit"))

<script>
function edit(e) {
    var roomResourceDataSource = this.resources[0].dataSource;
    //get target resource object (which contains the color)
    var resource = roomResourceDataSource
        .data()
        .filter(function(item) {
            return item.value === e.event.roomId
        });
 
    if (resource.length > 0) {
        resource = resource[0];
    }
 
    var color = resource.color || "black";
 
    e.container.parent().css("border", "3px solid " + color);
}
</script>

You can extend the above example to change the Window title as follows:

edit: function(e) {
     e.container.data("kendoWindow").setOptions({title: "new Title"});

Also I'm not sure what exactly do you mean with "change the layout" - could you please elaborate more on this?

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
venkata
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
venkata
Top achievements
Rank 1
Share this question
or