0

Control UI for Calendars (not Calendar)

asked 2017-09-27 21:09:11 +0800

54patman gravatar image 54patman
13 3

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

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-09-28 11:09:25 +0800

cor3000 gravatar image cor3000
6280 2 7

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

link publish delete flag offensive edit

Comments

Thanks for the reply. I'll see what I can do.

54patman ( 2017-09-28 21:53:14 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2017-09-27 21:09:11 +0800

Seen: 16 times

Last updated: Sep 28 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More