Hi Team,
I am using GWT 2.8.1 and SmartGWT 6.1 power version.
I am using smart gwt Calendar of month view . And setting CalendarEvent data by calendar.setData(CalendarEvent[]).
The method getDayBodyHTML() is overridden to provide description for DayBody cell details.
Calendar calendar = new Calendar() {
@Override
public String getDayBodyHTML(final Date date, final CalendarEvent[] events, final Calendar calendar, final int rowNum, final int colNum) {
String body= DateUtil.getDisplayDay(date);
if (events != null && events.length > 0) {
for (CalendarEvent event : events) {
body=body+event.getName();
//Other stuff
}
}
return body;
}
}
now issue i am facing..
1. If i have added CalendarEvent to calendar which have startDate and endDate on different day.
new CalendarEvent(projectTaskId,
caption,
eventMessages,
startDate, // Start date 17-Nov-2017
completedDate // Complete date 19-Nov-2017 (see its 3 day event)
);
However in calendar representation
@Override
public String getDayBodyHTML(final Date date, final CalendarEvent[] events, final Calendar calendar, final int rowNum, final int colNum) {
//**** The events array is giving event on 17-Nov(startDate) only but on date 18-Nov-2017 and 19-Nov-2017 (between and endDate), it is empty ***//
String body= DateUtil.getDisplayDay(date);
if (events != null && events.length > 0) {
for (CalendarEvent event : events) {
body=body+event.getName();
//Other stuff
}
}
return body;
}
Please suggest me how to show 3 day event in month view Calendar. `calendar.setEventOverlap(true)` is not helping even.
2. As i am using not editable calendarEvent `calendar.setCanEditEvents(false);` on mouse over i want to show some more information about calendarEvent for that i have used these option.
None is working for me.
A). calendar = new Calendar() {
@Override
public String getCellHoverHTML(CalendarView view, Record record, Integer rowNum, Integer colNum, Date date, String defaultValue) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(" ").append(DateUtil.getDisplayHours(date)).append(":").append(DateUtil.getDisplayHours(date));
return record.getAttribute("name") + stringBuilder.toString() + record.getAttribute("description") + record
.getAttribute("isFirst");
}
};
B). calendar.setEventHoverHTMLCustomizer(new EventHoverHTMLCustomizer() {
@Override
public String getEventHoverHTML(CalendarEvent calendarEvent, EventWindow eventWindow) {
return "mouse over text";
}
});
C). calendar.setEventCanvasHoverHTMLCustomizer(new EventCanvasHoverHTMLCustomizer() {
@Override
public String getHoverHTML(CalendarEvent calendarEvent, EventCanvas eventCanvas) {
return "mouse over text";
}
});
Please suggest solution for these issue.
Thanks
I am using GWT 2.8.1 and SmartGWT 6.1 power version.
I am using smart gwt Calendar of month view . And setting CalendarEvent data by calendar.setData(CalendarEvent[]).
The method getDayBodyHTML() is overridden to provide description for DayBody cell details.
Calendar calendar = new Calendar() {
@Override
public String getDayBodyHTML(final Date date, final CalendarEvent[] events, final Calendar calendar, final int rowNum, final int colNum) {
String body= DateUtil.getDisplayDay(date);
if (events != null && events.length > 0) {
for (CalendarEvent event : events) {
body=body+event.getName();
//Other stuff
}
}
return body;
}
}
now issue i am facing..
1. If i have added CalendarEvent to calendar which have startDate and endDate on different day.
new CalendarEvent(projectTaskId,
caption,
eventMessages,
startDate, // Start date 17-Nov-2017
completedDate // Complete date 19-Nov-2017 (see its 3 day event)
);
However in calendar representation
@Override
public String getDayBodyHTML(final Date date, final CalendarEvent[] events, final Calendar calendar, final int rowNum, final int colNum) {
//**** The events array is giving event on 17-Nov(startDate) only but on date 18-Nov-2017 and 19-Nov-2017 (between and endDate), it is empty ***//
String body= DateUtil.getDisplayDay(date);
if (events != null && events.length > 0) {
for (CalendarEvent event : events) {
body=body+event.getName();
//Other stuff
}
}
return body;
}
Please suggest me how to show 3 day event in month view Calendar. `calendar.setEventOverlap(true)` is not helping even.
2. As i am using not editable calendarEvent `calendar.setCanEditEvents(false);` on mouse over i want to show some more information about calendarEvent for that i have used these option.
None is working for me.
A). calendar = new Calendar() {
@Override
public String getCellHoverHTML(CalendarView view, Record record, Integer rowNum, Integer colNum, Date date, String defaultValue) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(" ").append(DateUtil.getDisplayHours(date)).append(":").append(DateUtil.getDisplayHours(date));
return record.getAttribute("name") + stringBuilder.toString() + record.getAttribute("description") + record
.getAttribute("isFirst");
}
};
B). calendar.setEventHoverHTMLCustomizer(new EventHoverHTMLCustomizer() {
@Override
public String getEventHoverHTML(CalendarEvent calendarEvent, EventWindow eventWindow) {
return "mouse over text";
}
});
C). calendar.setEventCanvasHoverHTMLCustomizer(new EventCanvasHoverHTMLCustomizer() {
@Override
public String getHoverHTML(CalendarEvent calendarEvent, EventCanvas eventCanvas) {
return "mouse over text";
}
});
Please suggest solution for these issue.
Thanks
Comment