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

Ejs grid filtering.

Thread ID:

Created:

Updated:

Platform:

Replies:

143903 Apr 9,2019 01:49 PM UTC Apr 10,2019 10:02 AM UTC Angular - EJ 2 1
loading
Tags: Grid
Shounak
Asked On April 9, 2019 01:49 PM UTC

Suppose i have applied a filter to the ejs grid, and the filtering is done. Now i want to have the data object of the grid after the filtering in my component class. How do i achieve this?

Also, is there a way to catch the filtering event, when i apply a filter.
Please help 

Hariharan J V [Syncfusion]
Replied On April 10, 2019 10:02 AM UTC

Hi Shounak, 
 
Thanks for contacting us. 
 
Query 1: “Now i want to have the data object of the grid after the filtering in my component class.” 
 
We suggest you to use `currentViewData` property form grid instance for getting filtered data.  Please refer the below code snippets. 
 
[app.component.ts] 
public actionComplete(args: FilterEventArgs): void { 
        if(args.requestType==='filtering')      { 
          console.log('filter action completed'); 
          console.log(this.grid.currentViewData); 
        } 
    } 
 
 
Query 2: “Also, is there a way to catch the filtering event, when i apply a filter.” 
 
You can use `actionBegin` and `actionComplete` event for handling filter actions on grid. Please refer the below samples for both queries. 
 
[app.component.html] 
<ejs-grid #grid [dataSource]='data' allowPaging='true' allowFiltering='true' [pageSettings]="pageOptions" (actionBegin)="actionBegin($event)" (actionComplete)="actionComplete($event)"> 
 
[app.component.ts] 
public actionBegin(args: FilterEventArgs): void {         
        if(args.requestType==='filtering')      { 
          console.log('filter action started'); 
        } 
    } 
 
 
 
Regards, 
Hariharan 


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