245
Views
7
Comments
Solved
[FullCalendar Reactive v6] Reactive Event Calendar V5
full-calendar-reactive-v5
Reactive icon
Forge asset by Rodrigo Silva
Platform Version
11.18.1 (Build 37828)

we can trigger ah client action in our outsystems when the next and previous button is clicked from the Event calendar is there any option can u please provide me the solution im just stuck with this
Forge Component Name:- Full Calendar Reactive V5

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Vimal,

One of the approach to register a datesSet event handler for the FullCalendar ReactiveV5 is:

  1. Define an OnReady event handler to the Calendar Basic block
  2. In the OnReady screen action flow, set the datesSet event handler using the JS node
  3. Create a screen action (for e.g., OnMonthChange) and invoke the same from the handler to receive all the incoming parameters like Month, MonthIndex, Year. 

JS Snippet:

document.getElementById($parameters.CalendarId).querySelector('.fCalendar').reactiveInstance.setOption('datesSet', function (event) {

    var midDate = new Date((event.start.getTime() + event.end.getTime()) / 2);
    var month = new Date(midDate).toLocaleString('default', { month: 'long' });
    var newDate = new Date(midDate);

    $actions.OnMonthChange(month, newDate.getMonth(), newDate.getFullYear());
});

Note: The month index value starts from 0 - January.

Demo Screen: FC_V5_MonthChangeEvt

Considering your use case, you will have to refresh the table data source in the Screen action (OnMonthChange) flow - referring the incoming month/year value.

Refer to the attached oml file for your reference. 

I hope this helps you!


Kind regards,

Benjith Sam

Sparkle_FC_V5_MonthChangeEvt.oml
2023-01-19 12-23-07
Abhinav Shilwant

Hi @g vimal jose ,

I have not completed understand what you want to say here.

Can you please elaborate more on this?

You want to implement "On Click" event of NEXT and PREVIOUS buttons. Is it?

If YES, Then that functionality is already present in the forge component. Check this demo.


See the above screenshots for NEXT and PREVIOUS button functionality.

Warm Regards,

Abhinav

UserImage.jpg
vimal jose

hear my requirement is want to trigger ah list at bottom of the calendar based on the month i have to filter the list and show the details at the bottom when the user clicks next month or previous month based on that i have to perform the bottom list 
When the user clicks on the next or previous button based on the clicked month i have to filter the aggrigate and show the details at bottom of the calendar.

EG:- what the month in that calendar the detail of the particular month in the calendar will show all the events at the bottom  from the aggrigate 

2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Vimal, 

You can achieve your use-case by defining the DataSet event handler in the FullCalendar block as highlighted below.

DataSet Event: Trigger after the calendar’s date range has been initially set or changed in some way and the DOM has been updated.

When the user clicks on the next or previous button the DataSet event gets invoked.

As per the official FullCalendar documentation the event is called DatesSet event.

Refer this link for more info: https://fullcalendar.io/docs/datesSet

I hope this helps you!


Kind regards,

Benjith Sam

UserImage.jpg
vimal jose

hai @Benjith Sam thanks for your suggestions, I'm using full calendar version V5 which is currently updated version in this we have only the calendar object so .i hope this wont work for me any way ill try so can u please give me the solution for full calendar V5 and i dint see any date sets events in the calendar

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Vimal,

One of the approach to register a datesSet event handler for the FullCalendar ReactiveV5 is:

  1. Define an OnReady event handler to the Calendar Basic block
  2. In the OnReady screen action flow, set the datesSet event handler using the JS node
  3. Create a screen action (for e.g., OnMonthChange) and invoke the same from the handler to receive all the incoming parameters like Month, MonthIndex, Year. 

JS Snippet:

document.getElementById($parameters.CalendarId).querySelector('.fCalendar').reactiveInstance.setOption('datesSet', function (event) {

    var midDate = new Date((event.start.getTime() + event.end.getTime()) / 2);
    var month = new Date(midDate).toLocaleString('default', { month: 'long' });
    var newDate = new Date(midDate);

    $actions.OnMonthChange(month, newDate.getMonth(), newDate.getFullYear());
});

Note: The month index value starts from 0 - January.

Demo Screen: FC_V5_MonthChangeEvt

Considering your use case, you will have to refresh the table data source in the Screen action (OnMonthChange) flow - referring the incoming month/year value.

Refer to the attached oml file for your reference. 

I hope this helps you!


Kind regards,

Benjith Sam

Sparkle_FC_V5_MonthChangeEvt.oml
UserImage.jpg
vimal jose

Tq so much for your solution its really helpfull Benjith sam 

2021-03-18 21-03-15
Benjith Sam
 
MVP

You're welcome, Vimal.

Glad to help you :)


Kind regards,

Benjith Sam

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.