1

我的应用程序中有一个剑道网格

@(Html.Kendo().Grid<TekstenViewModel.Tekst>()
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Template(@<text></text>).ClientTemplate("<input type='checkbox'/>").Width(10).Hidden(!Model.Administrator);
        columns.Bound(product => product.Naam).Width(125).ClientTemplate("<div id='editorDiv'><div class='input'>#=Naam#</div><div class='editor'>" + 
            Html.WebCore().LinkButton(type: ButtonType.MeerActies, htmlAttributes: new { onclick = "openPopupDemo('#: Naam #', '#: ID #', 'Naam')" }));
        columns.Bound(product => product.Waarde).Width(125).ClientTemplate("<div id='editorDiv'><div class='input'>#=Waarde#</div><div class='editor'>" +
            Html.WebCore().LinkButton(type: ButtonType.MeerActies, htmlAttributes: new { onclick = "openPopupDemo('#: Waarde #', '#: ID #', 'Waarde')" }));
        columns.Bound(product => product.Opmerking).Width(250).ClientTemplate("<div id='editorDiv'><div class='input'>#=Opmerking#</div><div class='editor'>" + 
            Html.WebCore().LinkButton(type: ButtonType.MeerActies, htmlAttributes: new { onclick = "openPopupDemo('#: Opmerking #', '#: ID #', 'Opmerking')" }));
        columns.Template(@<text></text>).ClientTemplate("<div id='deleteDiv'><div class='delete'><a class=\"delete iconBtn\" onclick=\"deleteResourceItem(#: ID #, '#: Naam #')\"></a></div></div>").Width(10).Hidden(!Model.Administrator);
    })
    .Pageable()
    .Sortable()
    .Filterable()
    .Events(events => events.Edit("onCellEdit"))
    .Groupable()
    .Navigatable()
    .Editable(editable => editable.Mode(GridEditMode.InCell).DisplayDeleteConfirmation(false))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .Model(model =>
        {
            model.Id(product => product.ID);
            model.Field(product => product.Naam).Editable(Model.Administrator);
            model.Field(product => product.Opmerking).Editable(Model.Administrator);
            model.Field(product => product.Waarde).Editable(!Model.ReadOnly);
            model.Field(product => product.RESOURCE_SET_ID).DefaultValue(Model.SetID);
            model.Field(product => product.Type).DefaultValue(Domain.Agromilieu2.Common.Objects.Entities.Resources.ResourceType.GLOBAL_RESOURCES);
            model.Field(product => product.Taal).DefaultValue(Domain.Agromilieu2.Common.Agromilieu2Constants.Resources.DEFAULT_TAAL_CODE);
        })
        .Create(create => create.Action(MVC.BeheerTeksten.ActionNames.ResourceItems_CreateUpdate, MVC.BeheerTeksten.Name))
        .Read(read => read.Action(MVC.BeheerTeksten.ActionNames.ResourceItems_Read, MVC.BeheerTeksten.Name, new { setID = Model.SetID }).Data("onReadAdditionalData"))
        .Update(update => update.Action(MVC.BeheerTeksten.ActionNames.ResourceItems_CreateUpdate, MVC.BeheerTeksten.Name))
        .Destroy(destroy => destroy.Action(MVC.BeheerTeksten.ActionNames.ResourceItems_Delete, MVC.BeheerTeksten.Name))
    )
)

这是它的照片。

在此处输入图像描述

当我点击一个虚线按钮时,它会打开一个Kendo editor带有所选单元格的值。到目前为止,上帝

在此处输入图像描述

如果我对文本进行格式化并保存,下次我尝试编辑它时,编辑器将无法打开。相反,文本将在默认输入中进行编辑。

在此处输入图像描述

做一个简单的格式化,比如

 <strong><em>Carolina</em></strong> 

仍然允许我打开编辑器,但如果我underline输入文本,例如,

<strong><em><span style="text-decoration:underline;">Carolina</span></em></strong>

编辑器将不起作用,文本将在默认输入中进行编辑。

如果我使用 Heading 格式化文本h1,例如,在删除下划线后,编辑器当然可以工作,但默认输入中的文本将有一个滚动条。

在此处输入图像描述

这只发生在格式化的文本中。有任何想法吗??

4

0 回答 0