PDA

View Full Version : Calendar Widget



itpragmatik
12 Dec 2009, 7:48 PM
Is there any Calendar widget available in GXT? Or is there any plan to include this in next release of GXT?

Thanks

gaspo100
13 Dec 2009, 9:07 PM
I use gwt-cal (http://code.google.com/p/gwt-cal/). It is GWT based but it integrates nicely with GXT, there three visual themes to choose from. They are working on adding the month view and some drag-drop features.

Code sample of adding the gwt-cal into TabItem:



TabItem ti = new TabItem();
ti.setLayout(new FitLayout());

CalendarSettings cs = new CalendarSettings();
cs.setIntervalsPerHour(4);
cs.setOffsetHourLabels(true);
cs.setTimeBlockClickNumber(Click.Double);
cs.setPixelsPerInterval(20);

// weekly 7 day view
dayView = new DayView();
dayView.setDays(7);
dayView.setSettings(cs);
dayView.addTimeBlockClickHandler(new TimeBlockClickHandler<Date>() {
public void onTimeBlockClick(TimeBlockClickEvent<Date> event) {
// do stuff here
}
});

ti.add(dayView, new FitData(10));