cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Planning Calendar

dgknayz
Discoverer
0 Kudos
486

Hello everyone,

My question about planning calendar,

If i create new appointment, calendar is refreshing and going current day.

Selected key is 'week'. And i want to if i create new appointment stay that week and refresh appointment.

Can you experts help me ?

Accepted Solutions (0)

Answers (1)

Answers (1)

shreyashrangrej
Participant
0 Kudos

Hi Doğukan

You can set the calendar's singleRow property to true. This will cause the calendar to stay on the current week when a new appointment is created.

<mvc:View
  controllerName="my.app.controller.Calendar"
  xmlns:mvc="sap.ui.core.mvc"
  xmlns="sap.m">
  <PlanningCalendar
    id="calendar"
    startDate="{path: '/startDate'}"
    rows="{path: '/people'}"
    singleRow="true"
    appointmentSelect="handleAppointmentSelect"
    >
    <rows>
      <PlanningCalendarRow
        text="{name}"
        appointments="{path: 'appointments'}">
        <appointments>
          <Appointment
            startDate="{start}"
            endDate="{end}"
            title="{title}"
            type="{type}"
            icon="{icon}"
            >
          </Appointment>
        </appointments>
      </PlanningCalendarRow>
    </rows>
  </PlanningCalendar>
</mvc:View>
dgknayz
Discoverer
0 Kudos

Hi Shreyash,

Thanks for reply but it doesn't work for me.

My view code is,

<PlanningCalendar id="PC1" startDate="{path: 'oModel>/Tarih'}" minDate="{path: 'oModel>/MinTarih'}" rows="{path: 'oModel>/PlanHeader'}"
					appointmentSelect="onPressPlan" viewKey="Week" rowSelectionChange="onRowSelectionChange" viewChange="onViewChange"
					showEmptyIntervalHeaders="false" intervalSelect="onAddPlan" startDateChange="onStartDateChange" singleRow="true">
					<toolbarContent>
						<Title text="İş Planı" titleStyle="H4"/>
						<Button id="addButton" type="Emphasized" icon="sap-icon://add" press="onPressAddButton" tooltip="Plan Ekle"/>
					</toolbarContent>
					<rows>
						<PlanningCalendarRow icon="{oModel>Link}" class="" key="{oModel>Uname}" title="{oModel>Tname}" text="{oModel>Statu}"
							appointments="{path : 'oModel>PlanNav', templateShareable: true}" intervalHeaders="{path: 'headers', templateShareable: false}">
							<appointments>
								<unified:CalendarAppointment key="{oModel>PlanId}" startDate="{oModel>BasTarih}" endDate="{oModel>BitTarih}" icon="{pic}"
									title="{oModel>Proje}" text="{oModel>Baslik}" type="{oModel>ColorType}"></unified:CalendarAppointment>
							</appointments>
							<intervalHeaders>
								<unified:CalendarAppointment startDate="{start}" endDate="{end}" icon="{pic}" title="{title}" type="{type}"></unified:CalendarAppointment>
							</intervalHeaders>
						</PlanningCalendarRow>
					</rows>
				</PlanningCalendar>