Our powerful JS Calendar component


Post by jesenko »

Hi,

Is it possible to prevent the date change on row click in agenda view?

I have the following use case:

  1. I need to prevent the date change when clicked on the agenda grid row/event
  2. I need to be able to click on the event to open a custom modal

I have tried with scss:

.b-cal-agenda-grid-row {
	pointer-events: none;
	.b-cal-event-wrap {
		pointer-events: all;
	}
}

This almost achieves the requirement but the click on event to open the modal
still changes the calendar date and I need to avoid that.

Is it possible to achieve this with the agenda view config or in any other way?

I searched the forum and api docs and could not find anything related.

Thanks


Post by Animal »

You can easily listen for eventClick and take action to create your own UI on that event

What damage does changing the orientation date of the Calendar do?


Post by jesenko »

I already use the eventClick to open the UI and that works as expected.

As for the date change, it has a negative impact for me because I have modified the agenda view behavior so that it shows only events from the selected date onwards (events prior the selected date are not displayed).
This means that a simple click on any event in the list will trigger filtering in my case (hide prior events).
Thats why I want to have the date change explicit (only with the datepicker) in case of agenda view.

Edit:
I found a way to deal with the behavior using the 'dateChange' event but in case there is some built in configuration setting please let me know.

Thanks


Post by Animal »

You have found the correct way. It just helps with orienting the whole Calendar to the date region the end user expressed an interest in.

So when switching modes you probably won't have noticed, but its always dhows what you were expecting to see. Switch to WeekView and its got the events you were working on.

That's because the Calendar's date is always the date the user interacts with.

Just be aware that when you veto the calendar date change, probably only do it if event.source.isAgendaView so that the calendar date contextual behaviour applies in all other contexts.


Post by jesenko »

Yes, I am doing it only in case of agenda view.

Thanks for the feedback.


Post Reply