小编use*_*571的帖子

为什么不在编辑器模板上显示剑道 ui 网格验证

为什么不在编辑字段的编辑器模板上向我显示网格验证?我不明白为什么不阅读数据注释。抱歉英语不好...

起初我像这样创建了剑道网格:

  <div id="grid">
    @(Html.Kendo().Grid<CardView>()
    .Name("Grid")
    .Columns(x =>
    {
        x.Bound(c => c.CardID).Title("Card Nm.");
        x.Bound(c => c.ExpirationDate).Format("{0:dd/MM/yyyy}");//.EditorTemplateName("KendoDatePicker");
        x.Command(cmd =>
        {
            cmd.Edit();
        }).Title("Edit");
    })
        .BindTo(Model)
        .DataSource(dataSource => dataSource
                    .Ajax()
                    .Model(model =>
                      {
                       model.Id(x => x.CardID);
                      })
                     .ServerOperation(true)
                     .Read(read => read.Action("Index", "Home"))
                     .Events(events => events.Error("error_handler"))
                     .Update(update => update.Action("Update", "Home"))
 .Editable(editable =>editable.Mode(GridEditMode.InLine)))
</div>
Run Code Online (Sandbox Code Playgroud)

这是在数据源事件错误中使用的 javascript:

<script>
 function error_handler(e, status) {//Klaidu isvedimas
        if (e.errors) {
            var message = "Error:\n";

            var grid = $('#GrdKendo').data('kendoGrid');
            var gridElement = grid.editable.element;

            var validationMessageTemplate = kendo.template(
                "<div id='#=field#_validationMessage' " + …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc razor kendo-ui kendo-grid

0
推荐指数
1
解决办法
1594
查看次数

标签 统计

asp.net-mvc ×1

c# ×1

kendo-grid ×1

kendo-ui ×1

razor ×1