打字稿版本:3.2.4 角度版本:^ 7.2.15 Syncfusion版本:17.1.50
大家好。我在Syncfusion的数据透视网格上遇到问题。下面的代码是我的onInit方法,直接从他们的演示中获取。从17.1.41开始,该工具已开始工作,但现在已经神奇地停止工作了。他们的StackBlitz示例中也存在此问题。
ngOnInit() {
let data: DataManager;
data = new DataManager({
url: this._controllerUrl + "/billing/extract",
adaptor: new WebApiAdaptor(),
crossDomain: true,
headers: [
{
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer " + this.token
}
]
});
this.dataSource = {
enableSorting: true,
columns: [{ name: "Year" }, { name: "Month" }],
values: [{ name: "Cost", caption: "Cost (GBP)" }],
data: data,
rows: [{ name: "ServiceId" }],
formatSettings: [],
expandAll: false,
filters: []
};
this.button = new Button({ isPrimary: true });
this.button.appendTo("#export");
this.button.element.onclick = (): void => {
this.pivotGridObj.excelExport();
};
}
这是Firefox中的完整错误:
ERROR Error: "Uncaught (in promise): TypeError: this.parent.dataSource.values is undefined
./node_modules/@syncfusion/ej2-pivotview/src/common/grouping-bar/axis-field-renderer.js/AxisFields.prototype.createPivotButtons@http://localhost:4200/views-billing-billing-module.js:197167:17
./node_modules/@syncfusion/ej2-pivotview/src/common/grouping-bar/axis-field-renderer.js/AxisFields.prototype.render@http://localhost:4200/views-billing-billing-module.js:197143:14
./node_modules/@syncfusion/ej2-pivotview/src/common/grouping-bar/grouping-bar.js/GroupingBar.prototype.appendToElement@http://localhost:4200/views-billing-billing-module.js:197347:49
./node_modules/@syncfusion/ej2-base/src/observer.js/Observer.prototype.notify@http://localhost:4200/views-billing-billing-module.js:10781:25
./node_modules/@syncfusion/ej2-base/src/component.js/Component.prototype.notify@http://localhost:4200/views-billing-billing-module.js:5505:32
./node_modules/@syncfusion/ej2-pivotview/src/pivotview/base/pivotview.js/PivotView.prototype.renderPivotGrid@http://localhost:4200/views-billing-billing-module.js:204990:18
./node_modules/@syncfusion/ej2-base/src/observer.js/Observer.prototype.notify@http://localhost:4200/views-billing-billing-module.js:10781:25
./node_modules/@syncfusion/ej2-base/src/component.js/Component.prototype.notify@http://localhost:4200/views-billing-billing-module.js:5505:32
./node_modules/@syncfusion/ej2-pivotview/src/pivotview/base/pivotview.js/PivotView.prototype.initEngine@http://localhost:4200/views-billing-billing-module.js:206000:14
./node_modules/@syncfusion/ej2-pivotview/src/pivotview/base/pivotview.js/PivotView.prototype.executeQuery@http://localhost:4200/views-billing-billing-module.js:206047:14
./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invoke@http://localhost:4200/polyfills.js:7688:26
onInvoke@http://localhost:4200/vendor.js:82616:33
./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invoke@http://localhost:4200/polyfills.js:7687:52
./node_modules/zone.js/dist/zone.js/</Zone.prototype.run@http://localhost:4200/polyfills.js:7447:43
scheduleResolveOrReject/<@http://localhost:4200/polyfills.js:8186:34
./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.js:7720:31
onInvokeTask@http://localhost:4200/vendor.js:82607:33
./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.js:7719:60
./node_modules/zone.js/dist/zone.js/</Zone.prototype.runTask@http://localhost:4200/polyfills.js:7492:47
drainMicroTaskQueue@http://localhost:4200/polyfills.js:7898:35
./node_modules/zone.js/dist/zone.js/</ZoneTask.invokeTask@http://localhost:4200/polyfills.js:7799:21
invokeTask@http://localhost:4200/polyfills.js:9041:14
globalZoneAwareCallback@http://localhost:4200/polyfills.js:9067:17
这是Chrome / Edge中的完整错误
core.js:15724 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at AxisFields.push../node_modules/@syncfusion/ej2-pivotview/src/common/grouping-bar/axis-field-renderer.js.AxisFields.createPivotButtons (axis-field-renderer.js:45)
at AxisFields.push../node_modules/@syncfusion/ej2-pivotview/src/common/grouping-bar/axis-field-renderer.js.AxisFields.render (axis-field-renderer.js:21)
at GroupingBar.push../node_modules/@syncfusion/ej2-pivotview/src/common/grouping-bar/grouping-bar.js.GroupingBar.appendToElement (grouping-bar.js:142)
at Observer.push../node_modules/@syncfusion/ej2-base/src/observer.js.Observer.notify (observer.js:89)
at PivotViewComponent.push../node_modules/@syncfusion/ej2-base/src/component.js.Component.notify (component.js:188)
at PivotViewComponent.push../node_modules/@syncfusion/ej2-pivotview/src/pivotview/base/pivotview.js.PivotView.renderPivotGrid (pivotview.js:881)
at Observer.push../node_modules/@syncfusion/ej2-base/src/observer.js.Observer.notify (observer.js:89)
at PivotViewComponent.push../node_modules/@syncfusion/ej2-base/src/component.js.Component.notify (component.js:188)
at PivotViewComponent.push../node_modules/@syncfusion/ej2-pivotview/src/pivotview/base/pivotview.js.PivotView.initEngine (pivotview.js:1891)
at PivotViewComponent.push../node_modules/@syncfusion/ej2-pivotview/src/pivotview/base/pivotview.js.PivotView.executeQuery (pivotview.js:1938)
at resolvePromise (zone.js:831)
at zone.js:896
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at drainMicroTaskQueue (zone.js:601)
at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:502)
at invokeTask (zone.js:1744)
at XMLHttpRequest.globalZoneAwareCallback (zone.js:1770)
关于这一点的怪异之处在于,如果我使用从服务器返回的数据的子集并在本地进行设置,那么所有这些都可以正常工作。
Here是我通过响应和数据提出的请求的图像。我不确定这是否可以解决,因为这可能是DataManager
的错误。
我试图恢复到以前的版本,但是似乎仍然存在相同的问题。
答案 0 :(得分:0)
我们很高兴地宣布,我们的Essential Studio 2019 Volume 2 Beta发行版17.2.0.28已随所提及的问题修复程序一起推出,可通过以下链接下载。
注意:此问题修复程序也将包含在我们的主版本中,预计将于2019年7月中旬发布。
我们感谢您的支持,感谢您耐心等待此版本。如果您需要任何进一步的帮助,请与我们联系。
致谢,
迪内什·巴布·亚达夫(Dinesh Babu Yadav)