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

Extending AgendaView using Razor part

4 Answers 102 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Erik
Top achievements
Rank 1
Erik asked on 11 Oct 2013, 08:30 AM
Hi,

I'm creating this new post from http://www.kendoui.com/forums.aspx/kendo-ui-web/scheduler/extending-agenda-view-to-show-whole-month-or-above-.aspx

Since I'm using the razor part I would like to know how to initialize the widget correctly. I've tried to put it together with the snippets from the above post but I cannot get it to work. Perhaps I'm missing something. Does anyone know how to do this properly?

This is what I have and it's not working:
<script type="text/javascript">
 
    var CustomAgenda = kendo.ui.AgendaView.extend({
        endDate: function () {
            var date = kendo.ui.AgendaView.fn.endDate.call(this);
            return kendo.date.addDays(date, 30);
        }
    });
    kendo.ui.Scheduler.fn.options.views = [{ type: "CustomAgenda", title: "My View" }];
 
</script>
 
@(Html.Kendo().Scheduler<Gusto.Web.Models.Scheduler.TaskViewModel>()
    .Name("scheduler")

4 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 11 Oct 2013, 08:52 AM
Hello Erik,

As I have mentioned in the previous thread setting custom views are not supported by the ASP.NET MVC wrapper.

However, here is a full declaration of a scheduler widget which uses the custom view in the way described in the thread you have referred to:

<script type="text/javascript">
 
    var CustomAgenda = kendo.ui.AgendaView.extend({
        endDate: function () {
            var date = kendo.ui.AgendaView.fn.endDate.call(this);
            return kendo.date.addDays(date, 30);
        }
    });
 
    kendo.ui.Scheduler.fn.options.views = [{ type: "CustomAgenda", title: "My View" }];
 
</script>
 
@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.TaskViewModel>()
    .Name("scheduler")
    .Date(new DateTime(2013, 6, 13))
    .StartTime(new DateTime(2013, 6, 13, 7, 00, 00))
    .Height(600)
    .Timezone("Etc/UTC")
    .DataSource(d => d
        .Model(m => {
            m.Id(f => f.TaskID);
            m.Field(f => f.OwnerID).DefaultValue(1);
        })
        .Read("Read", "Scheduler")
        .Create("Create", "Scheduler")
        .Destroy("Destroy", "Scheduler")
        .Update("Update", "Scheduler")
    )
)

Note that there are no views defined via the wrapper configuration.

In case it is required to have additional views shown, you will need to configure them via JavaScript similar to the way custom view configuration is defined:

kendo.ui.Scheduler.fn.options.views = [
    { type: "CustomAgenda", title: "My View" },
    "day",
    { type: "week", selected: true }
];



Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Lee
Top achievements
Rank 1
answered on 08 Mar 2017, 01:11 PM
Thank you, Rosen. This helped me a lot.
0
Nandakumar
Top achievements
Rank 1
answered on 21 Mar 2017, 11:07 AM

Hi Rosen,

We have a similar implementation used in our Project, but after the kendo upgrade 2017-R1. I notice with the Kendo.all.min.js, these events seems to be not firing..and only the MVC-Razors ones are working.

Any headups will be of great help!!

 

Thanks,

Nanda

0
Rosen
Telerik team
answered on 23 Mar 2017, 07:32 AM

Hello Nanda,

It seems that it is working as expected on our end. Therefore, please open a separate support request in which to provide as much information about your scenario as possible. Also a small runnable sample demonstrating the issue you are facing will be appreciated.

Regards,
Rosen
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Scheduler
Asked by
Erik
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Lee
Top achievements
Rank 1
Nandakumar
Top achievements
Rank 1
Share this question
or