When i route to a new page with tabs, i am selecting 2nd tab when loading
But it is always selecting 1st tab and i see script error
From another page
redirectToBacklog(row: any) {
console.log('redirect IN', row);
var getRouteLink = "/project-charts/backlog"
this.router.navigateByUrl(getRouteLink, { state: { rowDet: row } });
}
if (history.state.rowDet) {
if (this.tabInstance) {
this.itemId = history.state.rowDet.itemId;
this.selItemRow = this.aBacklogs.filter(e => e.itemId == this.itemId)[0];
this.tabInstance.selectedItem = 1;
}
console.log(' this.state$', this.selItemRow);
}
ERROR TypeError: Cannot read property 'children' of null
at TabComponent.getTrgContent (ej2-navigations.es2015.js:7697)
at TabComponent.setActive (ej2-navigations.es2015.js:7954)
at TabComponent.selectingContent (ej2-navigations.es2015.js:8576)
at TabComponent.
(ej2-navigations.es2015.js:8548) at TabComponent.push../node_modules/@syncfusion/ej2-angular-base/src/component-base.js.ComponentBase.trigger (component-base.js:318)
at TabComponent.select (ej2-navigations.es2015.js:8546)
at TabComponent.onPropertyChanged (ej2-navigations.es2015.js:8651)
at TabComponent.dataBind (ej2-base.es2015.js:5502)
at TabComponent.dataBind (ej2-base.es2015.js:6960)
at ZoneDelegate.invokeTask (zone-evergreen.js:399)
The error does not happen when i load the page normally(not from routing) or reload the page