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

Retrieve an array of events based on current view

Hi,

Currently, when I console log the data from the dataSource, it shows all the events in an array. I was wondering how would I retrieve an array of events based on current view? For example, if my current view is "Day", then I only retrieve data for "Day."


This is my code for reference:

<ScheduleComponent
        eventSettings={{
          dataSource:data,
          fields: {
            subject: { name:"Subject", validation: { required:true } },
          },
          location: {
            name:"Location",
            validation: {
              required:true,
            },
          },
          enableTooltip:true,
        }}
        selectedDate={newDate(2022, 9, 9)}
        actionComplete={(e) =>eventAction(e)}
        cellDoubleClick={cellDoubleClickEvent}
        navigating={(e) =>navigateEvent(e)}
      >
        <Injectservices={[Day, Week, WorkWeek, Month, Agenda]}/>
</ScheduleComponent>

1 Reply 1 reply marked as answer

VD Vinitha Devi Murugan Syncfusion Team October 26, 2022 10:32 AM UTC

Hi Jon,


Greetings from Syncfusion Support


You can get the current view event collections details by making use of getCurrentViewEvents public method of our Scheduler. Please refer below API and UG links for more information.


https://ej2.syncfusion.com/react/documentation/schedule/appointments/#get-the-current-view-appointments

https://ej2.syncfusion.com/react/documentation/api/schedule/#getcurrentviewevents


Regards,

Vinitha


Marked as answer
Loader.
Live Chat Icon For mobile
Up arrow icon