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

Editor template name

1 Answer 960 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Eitan
Top achievements
Rank 1
Eitan asked on 21 Sep 2018, 05:17 PM

Hi.

Trying to create a custom template for event editing using SchedulerEditableSettingsBuilder.TemplateName method but template seems to be ignored no matter what folder I put the template in.

page source:

@(Html.Kendo().Scheduler<Models.ScheduledTest>()
                                .Name("scheduler")
                                .AllDaySlot(false)
                                .CurrentTimeMarker(true)
                                .Date(new DateTime(2013, 6, 13))
                                .StartTime(new DateTime(2013, 6, 13, 10, 00, 00))
                                .EndTime(new DateTime(2013, 6, 13, 23, 00, 00))
                                .Editable(editable =>
                                {
                                    editable.TemplateName("TestEditorTemplate");
                                })
                                .EventTemplateId("test-template")
                                .Height(600)
                                .Views(views =>
                                {
                                    views.DayView();
                                    views.WeekView(weekView => weekView.Selected(true));
                                    views.MonthView();
                                })
                                .DataSource(d => d
                                    .Events(e => e.Error("onError"))
                                    .Model(m =>
                                    {
                                        m.Id(f => f.TestId);
                                    })
                                    .Read("Read", "Calendar")
                                    .Create("Create", "Calendar")
                                    .Destroy("Destroy", "Calendar")
                                    .Update("Update", "Calendar")
                                    )
)

 

~/Pages/EditorTemplates/TestEditorTemplate.cshtml

@model Models.ScheduledTest
@using (Html.BeginForm())
{
    <div class="k-edit-label">
        @(Html.LabelFor(model => model.Title))
    </div>
    <div data-container-for="title" class="k-edit-field">
        @(Html.TextBoxFor(model => model.Title, new { @class = "k-textbox", data_bind = "value:title" }))
    </div>
}

 

But the template is not detected and default template is used.

Should I put the template in a different path, or is there a way to help the component detect the template?

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 26 Sep 2018, 12:25 PM
Hello Eitan,

Please place the custom editor template file in Views->Shared->EditorTemplates and test the behavior.  Also, the Custom Editor view should be created as a partial view. 
Attached you will find a sample Telerik UI for ASP.Net Core project where Custom Editor is used for events editing.
I hope you will find it helpful.

Regards,
Neli
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Scheduler
Asked by
Eitan
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or