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

How do I change the title of a custom View?

2 Answers 75 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 11 Sep 2017, 03:52 PM

I have added a view to my scheduler:

@(Html.Kendo().Scheduler<MyEventViewModel>()
                .Name("Scheduler")
                .Views(v => {
                    v.DayView();
                    v.WeekView();
                    v.CustomView("MyCustomView");
                })

...and so on

...and I have defined this custom view as follows:

var MyCustomView = kendo.ui.MultiDayView.extend({
    options: {
        selectedDateFormat: "{0:D} - {1:D}",

        title: "this does not work"

    },
     title: "this does not work, either",
    calculateDateRange: function () {
        var start = this.options.date,
            idx, length,
            dates = [];
        for (idx = 0, length = 14; idx < length; idx++) {
            dates.push(start);
            start = kendo.date.nextDay(start);
        }
        this._render(dates);
    }
})

But I cannot seem to provide a title to this view to appear on the button. Specifying a title either in the view config, or the options of the view config does not work, and the CustomView method takes only one argument. I believe the javascript equivalent takes two arguments, with one being the title of the custom view, but the MVC version does not. ...so where do I set the title?

2 Answers, 1 is accepted

Sort by
0
Tom
Top achievements
Rank 1
answered on 12 Sep 2017, 11:00 AM

The answer, for posterity, is as follows:

.Views(v => { v.CustomView("MyCustomView", view => view.Title("Custom View Title"));})
0
Dimitar
Telerik team
answered on 12 Sep 2017, 02:29 PM
Hello Tom,

You are correct, the title can be changed by configuring the views.title property as specified in your second reply. You can find the respective documentation here.

Regards,
Dimitar
Progress Telerik
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
Tom
Top achievements
Rank 1
Answers by
Tom
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or