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

How to get event for Apply button in Date range picker

Hi Team,

I am using the date-range-picker component and want to handle on apply button click. 

can you please let me know how to get the event for apply button click as there is no such event in API reference.

Thanks,

Jayendra Rawat


1 Reply

VY Vinothkumar Yuvaraj Syncfusion Team December 19, 2022 05:01 PM UTC

Hi Jayendra Rawat,


We created a sample based on your requirements. In this sample, we used the popup open event to bind the click event to the apply button. For your convenience, please see the attached sample and code. 


App.component.html

<ejs-daterangepicker (open)="onOpen($event)">

</ejs-daterangepicker>



App.component.ts

export class AppComponent {

  onOpen(e) {

    setTimeout(function(){

      document

      .getElementsByClassName('e-apply e-btn')[0]

      .addEventListener('click'function () {

         alert("Clicked apply button");

      });

    },10);

  }

}

 


Sample : https://stackblitz.com/edit/angular-syncfusion-form-reset-bkdy6x?file=app.component.html,app.component.ts


Documentation : https://ej2.syncfusion.com/angular/documentation/api/daterangepicker/#open


Regards,

Vinothkumar


Loader.
Up arrow icon