0

I'm trying to retrieve particular day event ui element from angular UI calendar but there are no functions available.

Now I'm getting all Events UI components by

$('.fc-event-container')

which will provide all the event element UI rendered then I have to iterate over and find the corresponding event element UI.

Could any one please suggest me better way of retrieving event element of a particular day by date.

Note: Events in the calendar are recurring events so all will have same id on that day of the week

user2313833
  • 139
  • 1
  • 2
  • 14
  • what do you want to do with it, and at what point in the process? The API provides the "eventRender" callback (https://fullcalendar.io/docs/event_rendering/eventRender/) which runs just before the UI element is rendered and lets you manipulate it. – ADyson Dec 10 '17 at 19:54
  • I need to retrieve all events of particular day by providing date @ADyson – user2313833 Dec 12 '17 at 06:39
  • https://fullcalendar.io/docs/event_data/clientEvents/ will get you the actual event _objects_ (not the rendered element), which you can filter by date. Does that help? Again, you didn't explain what you actually want to do once you've acquired the information, and at what point in the process you want to do it? (e.g. during the loading of the event feed, or after a user clicks, or what?) That could affect the suggested solution. – ADyson Dec 12 '17 at 07:52
  • clientEvents will give all the events which are rendered in the view. I have requirement where when the calendar view is loaded I have to call another api and get a data and disable events present in that day only by matching with loaded event of that day. If I use clientEvents then I will get all the events(as there are many events present within the view), so I have to filter out with so many data. If any chance I gen get an events by providing the date then there will be no need of iterating over all the rendered events. @ADyson – user2313833 Dec 12 '17 at 08:41
  • using clientEvents and iterating over them _is_ how you filter them. There's no other way to get events via the fullCalendar API (although clientEvents accepts a filter callback which makes the coding a bit simpler). The only other solution you could consider is to make your call to this "other" API on your server-side, and remove the events from your feed before you send them to fullCalendar. If you want to disable them instead of remove, you could set a custom "disabled" flag on the relevant event objects, and then use the "eventRender" callback to check for that flag and disable the element – ADyson Dec 12 '17 at 10:08

0 Answers0