We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error thrown when hidemedia is enabled

Thread ID:

Created:

Updated:

Platform:

Replies:

148096 Oct 4,2019 11:27 PM UTC Oct 8,2019 12:39 PM UTC Angular - EJ 2 3
loading
Tags: Grid
Moses Fetters
Asked On October 4, 2019 11:27 PM UTC

Hello,  

Using 17.3.14 I get the following error

steps to reproduce
1. Create two grids on same page that can be toggled on and off (ngif) and add   hideAtMedia="(min-width: 600px)" to a column on grid 1
2. resize grid 1 a couple times so it falls below 600, then toggle to grid2 and start resizing, you will get the above error b/c the media query keeps the old grids reference but cant find the columns of grid 1 b/c it is no longer available

Pavithra Subramaniyam [Syncfusion]
Replied On October 7, 2019 12:37 PM UTC

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. 


Moses Fetters
Replied On October 7, 2019 01:18 PM UTC

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));
    }








Pavithra Subramaniyam [Syncfusion]
Replied On October 8, 2019 12:39 PM UTC

Hi Moses, 
 
Thanks for sharing the details. 
 
We are able to reproduce the reported issue at our end. We have logged a bug report for the reported issue as “Error thrown when hidemedia is enabled”. Thank you for taking  time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our upcoming October 30 Patch Release. 
 
Until then we appreciate your patience. 
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  
 
 
Note: Above feedback link is under review, once approved it will be visible. 
 
Regards, 
Pavithra S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon