2015-10-26 76 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'}, {...}]