我开发了一个使用Angular2,IgniteUI / Infragistics PivotGrid控件的应用程序来加载PivotGrid。我们动态传递Cubes信息,即Measures / Dimensions,并将json数据与PivotGrid绑定。我们在他们的github演示中使用IgniteUI / Infragistics提供的Angular2包装器组件。
这里有关于我申请的简明解释: -
工作簿是具有下拉列表的父组件。下拉列表的Onchange事件将触发PivotGrid组件(它是Workbook组件的子组件),以加载和绑定PivotGrid。绑定/加载PivotGrid网格后,它应加载PivotGrid的选择器。此选择器放置在此PivotGrid下的名为slideout的子组件中。基本上每当下拉列表发生变化时,它都应该分别加载适当的PivotGrid及其选择器组件。
我在这里遇到的问题是数据未正确绑定/加载数据透视网格/选择器。结果是每当我尝试更改选择器中的Measures / Dimensions时,PivotGrid都会崩溃,并显示以下错误消息。当我在选择器控件中连续尝试更改/修改时会出现此问题。
Uncaught TypeError: Cannot read property 'top' of undefined
at t.(anonymous function).(anonymous function)._positionOverlayDropAreas (http://localhost:3000/js/IgniteUI/infragistics.lob.js:662:19496)
at t.(anonymous function).(anonymous function)._positionOverlayDropAreas (http://code.jquery.com/ui/1.10.3/jquery-ui.min.js:5:5028)
at t.(anonymous function).(anonymous function)._onDataRendered (http://localhost:3000/js/IgniteUI/infragistics.lob.js:662:18161)
at t.(anonymous function).(anonymous function)._onDataRendered (http://code.jquery.com/ui/1.10.3/jquery-ui.min.js:5:5028)
at HTMLTableElement.dataRendered (http://localhost:3000/js/IgniteUI/infragistics.lob.js:661:12953)
at t.(anonymous function).(anonymous function)._trigger (http://code.jquery.com/ui/1.10.3/jquery-ui.min.js:5:10002)
at t.(anonymous function).(anonymous function)._renderData (http://localhost:3000/js/IgniteUI/infragistics.lob.js:138:17643)
at t.(anonymous function).(anonymous function)._renderData (http://code.jquery.com/ui/1.10.3/jquery-ui.min.js:5:5028)
at t.(anonymous function).(anonymous function).proxy (http://code.jquery.com/jquery-1.12.3.js:529:14)
at Class._invokeCallback (http://localhost:3000/js/IgniteUI/infragistics.core.js:270:30197)

请在URL
中找到示例来源即使我在行上向下钻取报告,它也会崩溃。 任何想法我在这里做的错误是什么?任何修复?
编辑: 现在我得到一个不同的错误,我提到的错误/异常可以在示例代码本身中重现。复制问题的步骤: -
Uncaught TypeError: Cannot read property 'key' of undefined
at t.(anonymous function).(anonymous function)._transformGridData (http://localhost:3000/js/IgniteUI/infragistics.lob.js:661:23266)
at t.(anonymous function).(anonymous function)._transformGridData (http://code.jquery.com/ui/1.10.3/jquery-ui.min.js:5:5028)
at t.(anonymous function).(anonymous function)._configureOptions (http://localhost:3000/js/IgniteUI/infragistics.lob.js:661:12632)
at t.(anonymous function).(anonymous function)._configureOptions (http://code.jquery.com/ui/1.10.3/jquery-ui.min.js:5:5028)
at t.(anonymous function).(anonymous function)._onGridUpdated (http://localhost:3000/js/IgniteUI/infragistics.lob.js:661:26768)
at t.(anonymous function).(anonymous function)._onGridUpdated (http://code.jquery.com/ui/1.10.3/jquery-ui.min.js:5:5028)
at Class.<anonymous> (http://localhost:3000/js/IgniteUI/infragistics.lob.js:661:9410)
at Class.dispatch (http://code.jquery.com/jquery-1.12.3.js:5226:27)
at Class.elemData.handle (http://code.jquery.com/jquery-1.12.3.js:4878:28)
at Object.trigger (http://code.jquery.com/jquery-1.12.3.js:5130:12)
&#13;
答案 0 :(得分:1)
首次创建透视网格时,应首先设置widgetId属性。 这应该在InfraPivotGrid Component:
中声明gridId属性时完成private gridId: string = "pivotGrid";
或者进入该类的构造函数:
constructor(private _SessionService: SessionService, private _WidgetConfigService: WidgetConfigService) {
console.log("In constructor of InfraPivotGrid");
this.gridId = "pivotGrid";
}