Setup- Add the gwt-cal jar file to your project's build path. Right-click on the project node in the Package Explorer and select 'Build Path > Add External Archives...'. Specify the downloaded gwt-cal-<version>.jar
- Modify <Your Application>.gwt.xml to inherit the gwt-cal module and theme:
<inherits name='com.bradrydzewski.gwt.calendar.Calendar' />
<inherits name='com.bradrydzewski.gwt.calendar.theme.google.Google' /> You will also need to download and add gwt-dnd (Drag Drop library). We used version 2.5, but it may also work with newer version. <inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/> Creating a CalendarAdding the calendar widget to a Panel just like any standard gwt widget. Calendar calendar = new Calendar();
calendar.setDate(new Date()); //calendar date, not required
calendar.setDays(3); //number of days displayed at a time, not required
calendar.setWidth("500px");
calendar.setHeight("400px");
add(calendar);Changing Viewsgwt-cal version 0.9 now supports multiple view. You can switch //Displays the Day View
calendar.setView(CalendarViews.DAY);
//Displays the Day View with 3 days
calendar.setView(CalendarViews.DAY, 3);
//Displays the month View
calendar.setView(CalendarViews.MONTH); Adding AppointmentsThe following code snippet demonstrates how to create and add an appointment to the calendar widget. Every time an appointment is added to the calendar widget the layout is re-calculated and performed. Appointment appt = new Appointment();
appt.setStart(...);
appt.setEnd(...);
appt.setTitle(...);
appt.addStyleName("gwt-appointment-blue");
calendar.addAppointment(appt);For now, if an appointment is multi day, you need to manually set the following appointment attribute: appt.setMultiDay(true); We plan to auto-calculate isMultiDay() before the final 0.9 version is released.
|
Hi!
Great work, There is a way to control what timeblock user click vent the user dont click an appointment????
Regards
Looking in the code, I find that I need to manage simple panel click on DayViewGrid?.java, get the position on the grid and fire an action to create an Appoinmet. I will do it by this way, are you interested on this contribution?
Regards
absolutely, any ideas to improve are welcome. Create a new Issue for this request and include some sample code and i'd be happy to add this functionality. I'm also interested in adding point/drag functionality to create an appointment that spans multiple time blocks.
If I want to display data from database saved on different date basic then for each action like next, previous ... iness method call i snecessary?
If I want to display data from database saved on different date basic then for each action like next, previous ... business method call is necessary? if yes then where to call ?