-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I'm using ZK7/8 (still trying both) and I want to use the Calendars product but I can't seem to figure out how to control the UI. I want to remove the Hours column, make the cells drag and droppable and other fun stuff. How do get access to the the renderer?
Thanks
Hi Patman,
drag/drop of calendar events should be enabled by default - as you can see in the ZK Calendar Demo.
Dragging an event will trigger an onEventUpdate
-Event. You have to listen to this event in order to apply the user change into the CalendarModel in order to update the UI (additionally you can save the updated information to your own persistence layer)
In the demo this happens in the Controller class CalendarController.java
//listen to the calendar-update of event data, usually send when user drag the event data
@Listen("onEventUpdate = #calendars")
public void updateEvent(CalendarsEvent event) {
DemoCalendarEvent data = (DemoCalendarEvent) event.getCalendarEvent();
data.setBeginDate(event.getBeginDate());
data.setEndDate(event.getEndDate());
calendarModel.update(data);
}
Similarly when dragging empty cells you have to listen to the onEventCreate
-Event in order to insert a new entry into the SimpleCalendarModel or provide a Dialog to edit the new event first.
I am not sure about removing the hours column right now - on the other hand I don't see how the calendar would be useful without that information.
Robert
Asked: 2017-09-27 21:09:11 +0800
Seen: 16 times
Last updated: Sep 28 '17