I am getting a TypeError when scrolling a grid with grouped columns. Everything seems to work, and the grid renders and scrolls correctly thought. The error only shows once you start the horizontal scroll.
The HTML:
<ejs-grid #grid id='grid' [allowSelection]="false" [allowPaging]="true" [pageSettings]='initialPage' [enableHover]='true'
[groupSettings]="groupOptions" [allowGrouping]="true" [allowSorting]="true" [dataSource]="flattened" width='100%' height='100%'>..</ejs-grid...
The typescript behind:
public groupOptions: GroupSettingsModel = { showDropArea: true, columns: ['seller', 'trancheClassName'] };
initialPage = { pageSize: 10 };
This is the error:
ERROR TypeError: Cannot read property 'length' of undefined
at FocusStrategy.push../node_modules/@syncfusion/ej2-grids/src/grid/services/focus-strategy.js.FocusStrategy.onFocus (focus-strategy.js:49)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:28233)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:503)
at invokeTask (zone.js:1671)
at HTMLElement.globalZoneAwareCallback (zone.js:1697)
The code causing the issue is in:
if (!this.parent.enableHeaderFocus && !this.parent.getCurrentViewRecords().length) {
this.getContent().matrix.
generate(this.rowModelGen.generateRows({ rows: [new Row({ isDataRow: true })] }), this.getContent().selector, false);
}
Any suggestions?
Many thanks