Filtersearchbegin

Hello,

I want to send additional params to back-end as I clear excel filter search word. But it seems the data call goes separately and before the actual filtersearchbegin, so I cannot insert additional params when in ActionBegin method. 

As it shown in the picture, the earliest method after filter search button X click is filtersearchbegin, but it doesn't have my additional params cause I assume it is called later and there is no action begin before actual filter GET call


Here's where I apply additional params in ActionBegin method


3 Replies

MS Madhu Sudhanan P Syncfusion Team October 10, 2018 01:22 PM UTC

 
Thanks for contacting Syncfusion support. 
 
The actionBegin event will be triggered with requestType as filterchoicerequest for the Excel filter data calls. You can modify your code like below to add the additional parameters for every excel filter calls. 
  
 
actionBegin(args) { 
    if (args.requestType === 'filtersearchbegin' 
    || args.requestType === 'filterchoicerequest') {  
        //Add additional parameters 
    } 
} 
 
 
 
Regards, 
Madhu Sudhanan P 




DO Domantas October 10, 2018 01:44 PM UTC

Hello,

I've tried with filterchoicerequest too, but filterchoicerequest does not fire when you type in searchbox or when you click X to clear it. The only thing that fires is filtersearchbegin, unless it can't be seen in action begin.

First type


Second type




MS Madhu Sudhanan P Syncfusion Team October 11, 2018 07:31 AM UTC

Hi Domantas, 
 
We suspect that you have added the parameters in grid component query property which is the cause of the problem. For excel filter the additional parameters should be added at the query property from the actionBegin event. 
 
Please find the below example code and sample link for your reference. 
 
[app.component.ts] 
export class AppComponent implements OnInit { 
        .  .  .  .  . 
    @ViewChild('grid') 
     public grid: GridComponent; 
    ngOnInit(): void { 
        .  .  .  .  .         
        this.filterSettings = { type: 'Excel' }; 
    } 
    actionBegin(args) { 
      if (args.requestType === 'filtersearchbegin' 
      || args.requestType === 'filterchoicerequest') { 
        args.query.addParams('ej2grid', 'true');  // you can add Parameters here 
      } 
  } 
} 


Regards, 
Madhu Sudhanan P 


Loader.
Up arrow icon