Ember 数据和 Handsontable 递归

Ember Data and Handsontable recursion

实例化 Handsontable 时,它​​会调用递归方法来构建数据模式:https://github.com/handsontable/handsontable/blob/be8654f78ca84efc982047ca6b399e6c6d99f893/src/dataMap.js#L28, which in turns calls objectEach: https://github.com/handsontable/handsontable/blob/master/src/helpers/object.js#L235-L245

但是,对于 Ember 数据记录,它会尝试遍历 store 等属性,这意味着它会陷入无限循环。

有没有办法绕过recursiveDuckSchema方法?

除非 Handsontable 有一些接口允许在数据到达插件的核心之前对其进行预解析,否则我想说,将 ember 数据模型转换为 handsometable 可以理解的东西可能会更好。

let queryParams = //Your query params
let data = this.get('getTheContent'); //Your models
let handsomeData = data.map(function(item, index, enumerable)){
   return { id: item.get('id'), name: item.get('name'), other: item.get('other') }
};
// Result is [{id: 1, name: 'John', other: 'Other'}, {...}]