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. Image for the cookie policy date
close icon

Strange behaviour after updating to 17.x

Before the version 17 update I was initially filtering the records on the dataBound event. Like this:

<ejs-grid (dataBound)='initFilter()></ejs-grid>

initFilter() {
console.log('bound');
this.filter(this.filterValue);
}

filter(value: string) {
if (value == 'all') {
this.gridObj.clearFiltering();
}
if (value == 'active') {
this.gridObj.filterByColumn('aktiv', 'equal', 'true');
}
if (value == 'inactive') {
this.gridObj.filterByColumn('aktiv', 'equal', 'false');
}
}

Now with the new update, the dataBound event gets fired at least 4 times and when I click on a button which filters let's say active, it tries to bind the data over and over again.

The data itself comes is sent to the grid through the parent component and gets resolved using the async pipe.

I can't reproduce this issue in a fresh Stackblitz project which I know makes it hard for you to help me but maybe somone has an idea how to deal with intial filtering now.

I tried

this.filterOptions = {
type: 'None',
columns: [{ field: 'aktiv', operator: 'equal', value: this.filter(this.filterByValue), predicate: 'and' }]
};

but that fails.

Thanks in advance

Paul




2 Replies

HJ Hariharan J V Syncfusion Team May 10, 2019 08:47 AM UTC

Hi Paul, 
  
We have validated your query. We have logged a bug report for the reported issue as “Invoking clearFiltering inside dataBound results in maximum call stack issue”. Thank you for taking the 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 end of May.  
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. 
  
  
We suggest you to use  the  below code snippet, Until the fix included. find the sample link for your reference. 
  
    initFilter() { 
    console.log('bound'); 
    this.filter('inactive'); 
  } 
  filter(value: string) { 
    if (value == 'all' && this.grid.filterSettings.columns.length ) {   //Check the filtered columns length 
      this.grid.clearFiltering(); 
    } 
    if (value == 'active') { 
      this.grid.filterByColumn('CustomerID', 'equal', 'VINET'); 
    } 
    if (value == 'inactive') { 
      this.grid.filterByColumn('OrderID', 'equal', 10248); 
    } 
  } 
  
  
  
If you still faced the issue or if we misunderstood your query, Please get back to us with the following details. 
  
  1. Explain about your requirement
  2. Share the Full Grid code
  
It will help us to provide a better solution as soon as possible. 
  
Regards, 
Hariharan 



TS Thavasianand Sankaranarayanan Syncfusion Team June 11, 2019 10:59 AM UTC

Hi Paul, 
Thanks for your patience. 
 
We are glad to announce that our latest patch release (17.1.50) has been rolled out successfully and in that release, we have added the fix for the issue Invoking clearFiltering inside dataBound results in maximum call stack issue. 
 
Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon