简体   繁体   中英

Error: [SlickGrid DataView] Each data element must implement a unique 'id' property

对于在使用 angular slick-grid 时遇到上述错误的用户:Angular slick grid 需要为每一行命名为“id”的列。

From typescript, after getting the data from the api, you can call other function which will do the following

addId() {
this.apiData.forEach((item, index) => {
  item.ids = index+1;
}
);
this.datasetRecords = this.apiData;

}

// assign the datasetRecords to the angular grid

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM