2015-10-26 73 views
0

当Handsontable被实例化时,它调用递归方法建立一个数据模式:https://github.com/handsontable/handsontable/blob/be8654f78ca84efc982047ca6b399e6c6d99f893/src/dataMap.js#L28,这又要求objectEachhttps://github.com/handsontable/handsontable/blob/master/src/helpers/object.js#L235-L245灰烬数据和Handsontable递归

然而,灰烬数据记录,它试图遍历如store,这意味着它会陷入无限循环。

有没有办法绕过recursiveDuckSchema方法?

回答

2

除非Handsontable有一些接口允许在解析数据到达插件核心之前进行预解析,否则我会说通过将你的余烬数据模型转化为帅帅可以理解的东西,你可能会有更好的运气。

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'}, {...}]