Telerik MVC Scheduler 自定义表单按钮标题
Posted
技术标签:
【中文标题】Telerik MVC Scheduler 自定义表单按钮标题【英文标题】:Telerik MVC Scheduler custom form buttons caption 【发布时间】:2018-02-09 11:29:40 【问题描述】:如何更改自定义 Telerik Scheduler 表单中的保存按钮标题? 我想要一个“书”标题而不是“保存”。这些按钮不在表单上,而是在调用“onAdd”事件时动态显示。 这是我的调度程序:
@(html.Kendo().Scheduler<SchedulerMVC.Controllers.HelpDeskRequestViewModel>()
.Name("scheduler")
.Editable(editable => editable
.Move(false)
.Resize(false)
.EditRecurringMode(SchedulerEditRecurringMode.Occurrence)
.TemplateId("editor-template")
)
.Selectable(false)
.AllDaySlot(false)
.ShowWorkHours(true)
.Footer(true)
.Views(views =>
views.WorkWeekView(workWeekView => workWeekView.Selected(true));
views.WeekView();
)
.Height(630)
.StartTime(new DateTime(2017, 6, 13, 6, 00, 00))
//.Timezone("Etc/UTC")
.Events(events =>
events.Add("onAdd");
events.Cancel("onCancel");
events.Change("onChange");
events.Edit("onEdit");
events.DataBound("onDataBound");
events.DataBinding("onDataBinding");
events.Navigate("onNavigate");
events.Save("onSave");
events.Remove("onRemove");
)
.DataSource(d => d
.Model(m =>
m.Id(f => f.ID);
m.Field(f => f.Title).DefaultValue("Booked");
m.Field(f => f.OwnerID).DefaultValue("1");
m.RecurrenceId(f => f.RecurrenceID);
)
.Read(read => read.Action("HelpDeskRequests_Read", "Scheduler"))
.Create(create => create.Action("HelpDeskRequests_Create", "Scheduler"))
.Update(update => update.Action("HelpDeskRequests_Update", "Scheduler"))
.Destroy(destroy => destroy.Action("HelpDeskRequests_Destroy", "Scheduler"))
)
)
这是我的模板表单:
<div class="col-xs-12 col-md-12 col-lg-12">
<script id="editor-template" type="text/kendo-x-tmpl">
<form class="form-horizontal">
<div class="alert alert-danger" style="width:90%; margin: 3px auto; display:none;">
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i> You don't have permitions to edit this item
</div>
<div class="col-xs-6 col-md-6 col-lg-6 token">
<label for="Token">Token:</label>
<input id="Token" type="text" class="k-textbox" data-bind="value: Token" placeholder="Token ID" name="Token" />
</div>
<div class="col-xs-6 col-md-6 col-lg-6">
<label for="Start" data-translator="formStartLabel">Start date and time:</label>
<input id="Start" data-role="datetimepicker" type="datetime" data-format="dd.MM.yyyy h:mm tt" data-bind="value:start" name="start" placeholder="Start date and time" />
</div>
<div class="col-xs-6 col-md-6 col-lg-6">
<label for="End" data-translator="formEndLabel">End date and time: </label>
<input id="End" data-role="datetimepicker" type="datetime" data-format="dd.MM.yyyy h:mm tt" data-bind="value:end" name="end" placeholder="End date and time" />
</div>
<input id="OwnerID" type="text" class="hidden" data-bind="value:OwnerID" name="OwnerID" />
</form>
</script>
而表单结果是这样的:
【问题讨论】:
【参考方案1】:Telerik 帮我解决这个问题,这就是诀窍
.Messages(m => m.Save("Book"))
【讨论】:
以上是关于Telerik MVC Scheduler 自定义表单按钮标题的主要内容,如果未能解决你的问题,请参考以下文章
在 Kendo Scheduler 自定义模板中绑定 DropDownList(ASP.NET MVC Wrapper 版本)
Kendo UI Scheduler - MVVM 设置日期