Hi Moses,
Thanks for contacting Syncfusion support.
Based on your query, we suspect that Grid 1 id was maintained on the Grid 2 while toggling. While performing toggle operation we have to destroy the grid or change the display style as ‘none’ to avoid duplicate reference. we suggest you to use the below way to achieve your requirement. Please refer the below code example and sample link for more information.
Regards,
Pavithra S.
I don't think this is the issue because it happens if I have a single grid on a page(component) and navigate away to a different page and come back to the page. Regardless if I do something like the following or not.
ngOnDestroy(): void {
this.grid.destroy();
}
It seems like using hideAtMedia has an issue where it does not removeaListener after it has been added
The following code in grids/src/grid/base/grid.ts adds a listener to a column, and that function gets hit each time however I don't see a place where the listener gets removed on grid destroy
private pushMediaColumn(col: Column, index: number): void {
this.mediaCol.push(col);
this.media[col.uid] = window.matchMedia(col.hideAtMedia);
this.mediaQueryUpdate(index, this.media[col.uid]);
this.media[col.uid].addListener(this.mediaQueryUpdate.bind(this, index));
}