我需要在 IgxGrid 上应用用户设置。我正在尝试的是,每当用户重新排序列时,我都会将列索引保存在我的数据库中,并且下次用户打开同一个网格时;我需要在他之前保存的网格上显示相同的设置。但是当我尝试设置列索引时,它说索引属性没有设置器。如何实现动态更改列索引的功能?这是我想要做的,
for (var iterator = 0; iterator < gridSettings.ColumnSettings.length; iterator++) {
if (this.componentRef.columns != null) {
for (let colIndex = 0; colIndex < this.componentRef.columns.length; colIndex++) {
if (this.componentRef.columns[colIndex].field == gridSettings.ColumnSettings[iterator].Key) {
this.componentRef.columns[colIndex].width = gridSettings.ColumnSettings[iterator].Width;
this.componentRef.columns[colIndex].index = gridSettings.ColumnSettings[iterator].Index;
break;
}
}
}
这是我遇到的错误,
错误错误:未捕获(承诺中):TypeError:无法设置只有getter的[object Object]的属性索引TypeError:无法设置只有getter的[object Object]的属性索引