是否有其他人遇到同步透视网格远程数据错误



打字稿版本:3.2.4角度版本:^7.2.15同步版本:17.1.50

大家好。我在使用Syncfusion的Pivot Grid时遇到了问题。下面的代码是我的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();
    };
  }

这是火狐中的完整错误:

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)

奇怪的是,如果我使用从服务器返回的数据子集并在本地设置它,它都可以正常工作。

这是我使用响应和数据发出的请求的图像。我不确定这是否是我可以修复的问题,因为这可能是DataManager的错误。

我尝试恢复到我使用的先前版本,但似乎仍然存在相同的问题。

我们很高兴地宣布,我们的 Essential Studio 2019 第 2 卷测试版版本 17.2.0.28 已随上述问题修复一起推出,可通过以下链接下载。

https://www.syncfusion.com/forums/145548/essential-studio-2019-volume-2-beta-release-v17-2-0-28-is-available-for-download

注意:此问题修复也将包含在我们的主版本中,预计将于 2019 年 7 月中旬推出。

我们感谢您的支持,并感谢您耐心等待此版本。如果您需要任何进一步的帮助,请与我们联系。

问候
迪内什·巴布·亚达夫

最新更新