问题描述
我使用 ignite-ui-angular 网格进行内联编辑,当我选择一行时它会突出显示所有行,并且保存/取消提示面板出现在错误的行中。他们的示例有效,但我正在自定义列,所以我认为可能是问题,但不确定如何解决。
解决方法
如Grid Row Editing topic中所述,行编辑操作需要“primaryKey”。
<igx-grid
[data]="data"
[primaryKey]="'ProductID'"
width="100%"
height="500px"
[rowEditable]="true"
></igx-grid>
考虑到这一点,我假设在您的场景中,“primaryKey”设置为 igxGridComponent 的基础数据源中不存在的列。
请确认主键设置正确。