Which event is getting triggered when we click on Today button ?

Which event is getting triggered when we click on Today button ? We need to add some custom function call when today button is clicked.

Image_4695_1704531608797


1 Reply

AK Ashokkumar Karuppasamy Syncfusion Team January 8, 2024 12:10 PM UTC

Hi Ravi,

We suggest using the schedule navigating and actionBegin events. In the actionBegin event, you can check if the clicked button is today or not, and accordingly, customize the code in either the actionBegin or navigating event. The attached code snippet and the following example illustrate the solution. Please give it a try, and feel free to reach out if you require any further assistance.


Sample: https://stackblitz.com/edit/schedule-today-button-click-jpszwe?file=index.js,index.css

[index.js]

const onNavigating = (args=> {

    if (isTodayClick) {

      // You can customize the code on the click of the 'Today' button

    }

    }

 

    const onActionBegin = (args=> {

      ifargs.event && args.event.target.innerText === 'Today' ) {

        debugger;

        console.log(args);

        isTodayClick = true;

        // You can customize the code on the click of the 'Today' button

      }

    }

 

    const [eventSettingssetEventSettings] = useState({ dataSource: dataeditFollowingEvents: false });

    return (<div className='schedule-control-section'>

      <div className='col-lg-9 control-section'>

        <div className='control-wrapper'>

          <ScheduleComponent width='100%' height='650px' actionBegin={onActionBegin} navigating={onNavigating} selectedDate={new Date(2021120)} ref={scheduleObj} eventSettings={eventSettings}>

 



Regards,
Ashok


Loader.
Up arrow icon