Announcement

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

  • Customizing CalendarEvent titles in Month View

    Hi - I was wondering if it is possible to either hide the startDate component of CalendarEvents or completely customize the title of these events. We use the Month view to display a read-only view of all day events and the time is irrelevant to us, and can be confusing for our users. Our calendars are data bound and include all relevant information (startDate, endDate, description, eventId, name ... etc). We are on SmartGWT 6.1.

    Edit: Just to be clear as an example from your showcase (https://www.smartclient.com/smartgwt...endar_category) instead of "8:00 Meeting" or "9:00 Realtor" we would just want to display "Meeting" or "Realtor" without the time component which I believe is auto drawn from the startDate?.
    Last edited by brandontrogers; 6th Aug 2019, 08:44.

  • Isomorphic
    replied
    Sorry for the confusion here - instead of overriding the getters, you need to use the "setEventHeaderHTMLCustomizer()" API

    Let us know if that doesn't work as expected

    Regards
    Isomorphic Software

    Leave a comment:


  • brandontrogers
    replied
    Hi, I've tried to implement these two overrides and the SC.logWarn()s never fire. This is in SmartGWT 6.1p (v11.1p_2019-08-17/Enterprise Deployment (built 2019-08-17)) nightly build from August 17. Please let me know if this is incorrect usage.
    Code:
    final Calendar calendar = new Calendar() {
    
                @Override
                public String getEventHeaderHTML(CalendarEvent event) {
                    SC.logWarn(event.getName());
                    return event.getName();
                }
    
                @Override
                public String getEventHeaderHTML(CalendarEvent event, CalendarView view) {
                    SC.logWarn(event.getName());
                    return event.getName();
                }
    
            };

    Leave a comment:


  • brandontrogers
    replied
    Thanks, will try this out.

    Leave a comment:


  • Isomorphic
    replied
    You could override Calendar.getDayBodyHTML(), to return entirely custom content for a MonthView cell, but that's probably overkill - doing that would remove the builtin "+ Nnn more..." link (and it's menu) that shows when a day has many events, and you'd need to implement something similar yourself.

    Instead, as of builds dated August 8 and later (tomorrow), we've made a change so that you can override existing API Calendar.getEventHeaderHTML(event, view) instead, and that will now affect the titles of events when rendered as cell-content in a MonthView, as well as when rendered as EventCanvases in other views.

    Leave a comment:

Working...
X