Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How do i set the cursor on Calendar DayBody?

    I have a compact Calendar with a DayBodyClickHandler, so I want the Cursor over DayBody to be a HAND.

    I have tried Calendar.setCursor() and

    Code:
            CalendarView cv = new CalendarView();
            cv.setCursor(Cursor.HAND);
            calendar.setAutoChildProperties("monthView", cv);
    But none of it worked.

    How do I set the Cursor the Calendar DayBody?

    #2
    You could install a DateCSSTextCustomizer that returns "cursor: pointer;" for date cells - is that what you're looking for?

    Comment


      #3
      Yes! Thank you.
      Code:
              calendar.setDateCSSTextCustomizer(new DateCSSTextCustomizer() {
                  
                  @Override
                  public String getDateCSSText(Date date, int rowNum, int colNum, CalendarView calendarView) {
                      int currentMonth = calendar.getPeriodStartDate().getMonth();
                      if (date.getMonth() == currentMonth) {
                          return "cursor: pointer;";
                      }
                      return null;
                  }
              });

      Comment

      Working...
      X