批量编辑不是 igx-grid 的已知 属性
Batch editing is not a known property of igx-grid
我想为 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>
P.S。我用 Angular 12.
你的代码看起来不错。请注意,batchEditing was introduced in IgniteUI for Angular 12.1.0. Check if your version of IgniteUI is newer or equal to 12.1.0. If you have older version you can update with ng update
as shown in the Update Guide.
我想为 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>
P.S。我用 Angular 12.
你的代码看起来不错。请注意,batchEditing was introduced in IgniteUI for Angular 12.1.0. Check if your version of IgniteUI is newer or equal to 12.1.0. If you have older version you can update with ng update
as shown in the Update Guide.