Announcement

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

    Calendar Month View Hover Width

    Hi, I have set a custom hover text on my Calendar via setMonthViewHoverHTMLCustomizer.

    How do I control the width of this hover?

    #2
    Any answer to this?

    Comment


      #3
      You could use calendar.setAutoChildProperties() to set the "hoverWidth" on the "monthView" autoChild

      Comment


        #4
        Worked like a charm, Thank you.

        Comment


          #5
          I am now facing a similar problem with a Timeline. I want to increase the width of the hover when I mouse over an event, but setting the "hoverWidth" ion the "timelineView" autochild doesn't work.

          Code:
          final Canvas properties = new Canvas();
          properties.setHoverWidth(500);
          timeline.setAutoChildProperties("timelineView", properties);
          How do I change the width of the event hover in the timeline?

          Comment


            #6
            Which version of SmartGWT?

            If it's 5.0 or later, you can use calendar.setAutoChildProperties() again, to set the hoverWidth on the "eventCanvas" autoChild.

            Comment


              #7
              SmartClient Version: v10.0p_2015-02-09/Pro Deployment (built 2015-02-09)

              The following doesn't work:
              Code:
              final Canvas properties = new Canvas();
              properties.setHoverWidth(1000);
              
              timeline.setAutoChildProperties("eventCanvas", properties);
              
              timeline.setEventHoverHTMLCustomizer(new EventHoverHTMLCustomizer() {
                  @Override
                  public String getEventHoverHTML(CalendarEvent calendarEvent, EventWindow eventWindow) {
                      DateTimeFormat dtf = DateTimeFormat.getFormat("d/M, yyyy");
                      String hoverHtml = dtf.format(calendarEvent.getStartDate()) + " - " + dtf.format(calendarEvent.getEndDate()) + "<br>";
                      hoverHtml += calendarEvent.getName() + "<br>";
                      hoverHtml += calendarEvent.getDescription();
                      return hoverHtml;
                  }
              });
              The hover width is still the default I think (see attached picture).

              Am I doing it wrong?
              Attached Files

              Comment


                #8
                5.0 comes with a new EventCanvas widget, and a new set of customizers that use it as a parameter type. You're installing a customizer that uses EventWindow as a parameter type.

                The first thing to do is install an EventCanvasHoverHTMLCustomizer instead.

                If you still see this problem, let us know and we'll take a look at the hover mechanism.

                Comment


                  #9
                  I have changed to customizer to this one, but the width of the hover is still not changing size.

                  Code:
                  timeline.setEventCanvasHoverHTMLCustomizer(new EventCanvasHoverHTMLCustomizer() {
                  	
                  	@Override
                  	public String getHoverHTML(CalendarEvent calendarEvent, EventCanvas eventCanvas) {
                  		DateTimeFormat dtf = DateTimeFormat.getFormat("d/M, yyyy");
                          String hoverHtml = dtf.format(calendarEvent.getStartDate()) + " - " + dtf.format(calendarEvent.getEndDate()) + "<br>";
                          hoverHtml += calendarEvent.getName() + "<br>";
                          hoverHtml += calendarEvent.getDescription();
                          return hoverHtml;
                  	}
                  });

                  Comment


                    #10
                    As of builds dated February 14, you should find that setting hover-related properties globally on EventCanvas, via the Calendar.eventCanvas autoChild or directly on calendarViews (depending on which type of hovers you want), will affect things as you expect.

                    Comment

                    Working...
                    X