我发现我需要同时忽略 entityAspect 和 entityType(来自自定义数据源 kendo 数据源的片段):
this.entityManager.executeQuery(query)
.then(function (xhr) {
if (self.autoMapToJS) { // Breeze entities contain recursive properties (ugh!) - eliminate those
payload.data = ko.mapping.toJS(xhr.results, {
ignore: ['entityAspect', 'entityType']
});
} else {
payload.data = xhr.results;
}
if (self.inlineCount) {
payload.total = xhr.inlineCount;
}
options.success(payload); // notify the DataSource that the operation is complete
})
.fail(function (rejected) {
payload.error = rejected;
})
.done(); // terminate chain of promises
}
特别是,尝试与网格(wijmo 和剑道)一起使用时,我被迫映射微风数据或享受堆栈溢出,因为这些控件将遍历属性。