How do I change the title of a custom View?

3 posts, 0 answers
  1. Tom
    Tom avatar
    18 posts
    Member since:
    Apr 2016

    Posted 11 Sep Link to this post

    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. Tom
    Tom avatar
    18 posts
    Member since:
    Apr 2016

    Posted 12 Sep in reply to Tom Link to this post

    The answer, for posterity, is as follows:

    .Views(v => { v.CustomView("MyCustomView", view => view.Title("Custom View Title"));})
  3. Dimitar
    Admin
    Dimitar avatar
    225 posts

    Posted 12 Sep Link to this post

    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.
Back to Top