What steps will reproduce the problem?
1. not using absolute position on calendar
2.
3.
What is the expected output? What do you see instead?
i get wrong values depending on the changes to size and position of the
calendar widget
What version of the product are you using? On what operating system?
9.1
Please provide any additional information below.
i have a solution replace dayClicked() in MonthView class line 434
public int getRelativeX(Element target,Event e) {
return e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() +
target.getOwnerDocument().getScrollLeft();
}
/**
* Gets the mouse y-position relative to a given element.
*
* @param target the element whose coordinate system is to be used
* @return the relative y-position
*/
public int getRelativeY(Element target,Event e) {
return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() +
target.getOwnerDocument().getScrollTop();
}
private void dayClicked(Event event) {
int x = getRelativeX(appointmentCanvas.getElement(), event);
int y = getRelativeY(appointmentCanvas.getElement(), event);
int row = (int) Math.floor(y / (appointmentCanvas.getOffsetHeight() / monthViewRequiredRows));
int col = (int) Math.floor(x / (appointmentCanvas.getOffsetWidth() / DAYS_IN_A_WEEK));
calendarWidget.fireTimeBlockClickEvent(
cellDate(row * DAYS_IN_A_WEEK + col));
}
Original issue reported on code.google.com by fenster....@gmail.com on 16 Jul 2010 at 11:21
Original issue reported on code.google.com by
fenster....@gmail.com
on 16 Jul 2010 at 11:21