首页 > 解决方案 > 在 kendo-grid 中添加新条目时发生错误

问题描述

在剑道网格中添加新条目时遇到问题。数据正在保存,但出现如下错误:

编辑指令的默认编辑服务仅在绑定到普通数组时有效。请提供编辑服务。

甚至谷歌也无法对此给出任何答案。

以下是我的html:

<kendo-grid-command-column width="70">
    <ng-template kendoGridCellTemplate let-isNew="isNew" let-dataItem="dataItem">
        <button kendoGridEditCommand type="button" [disabled]="HasProcessed" (click)="editCustomDednDetails(dataItem)" [primary]="true">
            <img src="/FinTechApp/assets/images/ico_edit.png">
        </button>
        <button type="button" kendoGridRemoveCommand [disabled]="HasProcessed" *ngIf="!dataItem.IsInEditMode" (click)="fnDeletecustomdeductionDetails(dataItem.EmpMonthlyCustomDeductionDetailsId)">
            <img src="/FinTechApp/assets/images/ico_delete.png">
        </button>
        <button kendoGridSaveCommand type="button" (click)="fnUpdateEmpCustomDednDetails(dataItem)">
            {{ isNew ? '' : '' }}
            <img src="/FinTechApp/assets/images/ico_save.png" title="Add">
        </button>
        <button kendoGridCancelCommand type="button">
            {{ isNew ? '' : '' }}
            <img src="/FinTechApp/assets/images/ico_cancel.png" title="Cancel">
        </button>
    </ng-template>
</kendo-grid-command-column>

下面是我正在使用的编辑按钮命令:

editCustomDednDetails(data) {
    var CustomDeductionObj: CustomDeduction = data;
    CustomDeductionObj.IsInEditMode = true;
    this.SelectedDedHead = new DeductionHeads();
    this.SelectedDedHead.DeductionHeadId = data.DeductionHeadId;
    this.finTechService.OperationType = PageAccessType.Edit;
}

随时问任何问题。我真的是一团糟。

提前致谢

标签: angulartypescriptkendo-uikendo-grid

解决方案


推荐阅读