1

我想为 igx-grid 启用批量编辑,以允许将已编辑的行提交到数据库。但我得到了错误: error-batch

我已经在app.modules.ts中导入了 IgxGridModule。为什么我会收到此错误?

这是我的网格。

  <igx-grid #grid1
            [batchEditing]="true"
            [data]="posts"
            width="80%" 
            height="600px"
            style="margin: auto"
            [showToolbar]="true"
            toolbarTitle="Cars"
            [allowFiltering]="true"
            [columnHiding]="true"
            [hiddenColumnsText]="'hidden'"
            [columnPinning]="true"
            [pinnedColumnsText]="'pinned'"
            [primaryKey]="'examplelotId'"
            [rowEditable]="true">
    <igx-grid-toolbar>
      <igx-grid-toolbar-title>Example Table</igx-grid-toolbar-title>
    </igx-grid-toolbar>

    <igx-column field="examplelotId" dataType="number" header="LotId" [sortable]="true" [movable]="true"></igx-column>
    <igx-column field="exampleproduction" header="Production" [sortable]="true" [movable]="true" [dataType]="'string'"></igx-column>
    <igx-column field="exampledepartment" header="Department" dataType="string" [sortable]="true" [movable]="true">

    </igx-column>

    <igx-column width="100px" [filterable]="false">
      <ng-template igxCell let-cell="cell">
        <button igxButton="icon" (click)="removeRow($event, cell.cellID)">
          <igx-icon>delete</igx-icon>
        </button>
      </ng-template>
    </igx-column>
  </igx-grid>

PS我使用Angular 12。

4

1 回答 1

4

你的代码看起来不错。请注意,批处理编辑是在Angular 12.1.0的IgniteUI中引入的。检查您的 IgniteUI 版本是否更新或等于 12.1.0。如果您有旧版本,您可以按照更新指南中的说明进行更新。ng update

于 2021-08-21T12:53:56.653 回答