cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter sap.m.PlanningCalendar appointments by date

frasie
Advisor
Advisor

I have bound the sap.m.PlanningCalendar control to an oData V4 service. This is working fine so far, but this will always load all existing appointments.

It works when adding a filter in the view. But only with static values.

<PlanningCalendarRow
	appointments="{
		path: 'taskAssignments', 
		filters: [{
			path : 'startDate',
			operator : 'LE',
			value1 : '2021-03-31T23:59:59.999Z'
		},{
			path : 'endDate',
			operator : 'GE',
			value1 : '2021-03-01T00:00:00.000Z'
		}]
	}">

Is it somehow possible to create this filter dynamically based on PlanningCalendar.getStartDate() and PlanningCalendar.getEndDate()? So far I can only adjust the filter for the PlanningCalendar rows aggregation. But not for the nested appointments aggregation.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member656694
Participant
0 Kudos
frasie
Advisor
Advisor

Hi rabin_dhas,

Thanks for your hint. Suspend/resume is a great feature. But that does not solve my problem. I am able to set the filter for the PlanningCalendar rows binding.

oPC1.getBinding("rows")

However, I cannot access the appointments binding of the PlanningCalendarRow.

It is possible to set the appointments filter like this:

oPC1.getBindingInfo("rows").template.mBindingInfos.appointments.filters = aFilters;

But I doubt that this is sapui5 coding standards conform. Would be nice if the planning calendar would provide an out of the box functionality for this requirement.