How to customized event template base on status

4 posts, 0 answers
  1. venkata
    venkata avatar
    3 posts
    Member since:
    Jul 2016

    Posted 14 Jul Link to this post

    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 
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 18 Jul Link to this post

    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.
     
  3. Kendo UI is VS 2017 Ready
  4. venkata
    venkata avatar
    3 posts
    Member since:
    Jul 2016

    Posted 21 Jul Link to this post

    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 

  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 22 Jul Link to this post

    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.
     
Back to Top
Kendo UI is VS 2017 Ready