Announcement

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

    day height in calendar month view

    SmartClient Version: v10.0p_2015-05-24/Pro Deployment (built 2015-05-24)

    After updating to the latest nightly, my calendar looks different.

    Before updating, the height of the days in my calendar would fill the available space in the calendar but now they are only as high as their html content.

    My calendar has showDayHeaders false, and the docs for setMinimumDayHeight says:
    "If showDayHeaders is false, this attribute has no effect - the minimum height of day cells is either an equal share of the available height, or the rendered height of the cell's HTML content, whichever is greater. If the latter, a vertical scrollbar is shown."

    but that doesn't seem to be the case.

    http://www.smartclient.com/smartgwt/showcase/#compact_calendar_category
    is showing the same behavior.

    Is this a bug or just outdated docs?

    How do I get my calendar back to filling the available space?

    My calendar settings:
    Code:
    final Calendar calendar = new Calendar();
    calendar.setWidth100();  
    calendar.setHeight100();  
    calendar.setShowDayView(false);  
    calendar.setShowWeekView(false);  
    calendar.setShowOtherDays(false);
    calendar.setShowDayHeaders(false);
    calendar.setShowDatePickerButton(false);  
    calendar.setShowAddEventButton(false);  
    calendar.setDisableWeekends(false);          
    calendar.setShowDateChooser(false);  
    calendar.setCanCreateEvents(false);
    calendar.setShowControlsBar(false);
    calendar.setDataSource(calendarDS);  
    calendar.setAutoFetchData(true);
    final Canvas properties = new Canvas();
    properties.setHoverWidth(250);
    calendar.setAutoChildProperties("monthView", properties);
    calendar.setMonthViewHoverHTMLCustomizer(new MonthViewHoverHTMLCustomizer() {
    	
    	@Override
    	public String getMonthViewHoverHTML(Date currentDate, CalendarEvent[] events) {
    		
    		if(events.length == 0)
    			return null;
    		
    		Integer minutes = null;
    		String deadlines = "";
    		String milestones = "";
            
            for (CalendarEvent calendarEvent : events) {
            	if(calendarEvent.getAttribute("minutes") != null)
            		minutes = calendarEvent.getAttributeAsInt("minutes");
            	
            	if(calendarEvent.getAttribute("deadline") != null)
            		deadlines += calendarEvent.getAttribute("deadline") +"<br>";
            	
            	if(calendarEvent.getAttribute("milestone") != null)
            		milestones += calendarEvent.getAttribute("milestone") +"<br>";
    		}
            
            DateTimeFormat dtf = DateTimeFormat.getFormat("EEEE MMM. d, yyyy");
            String hoverHtml = dtf.format(currentDate) + "<br>";
            
            if(minutes != null)
            	hoverHtml += "Reported Hours: " + minutes/60 + " h " + minutes % 60 + " min <br>";
            
            if(!deadlines.equals(""))
            	hoverHtml += "Deadlines:<br>" + deadlines;
            if(!milestones.equals(""))
            	hoverHtml += "Milestones:<br>" + milestones;
            		
    		return hoverHtml;
    	}
    });
    calendar.addDayBodyClickHandler(new DayBodyClickHandler() {  
        public void onDayBodyClick(DayBodyClickEvent event) {
        	openRegisteredTimeModal(event.getDate(), calendar);
        }  
    });
    calendar.setDateStyleCustomizer(new DateStyleCustomizer() {
    	
    	@Override
    	public String getDateStyle(Date date, int rowNum, int colNum, CalendarView calendarView) {
    		for (Integer weekendDay : DateUtil.getWeekendDays()) {
    			if(date.getDay() == weekendDay)
    				return "calendarDark";
    		}
    		return null;
    	}
    });

    #2
    Hi, I can see that the calendar in the showcase is back to normal, does this mean that it has been fixed in the current nightly? Will it work if I update now?

    Comment


      #3
      Yes, this was also fixed on May 25, so you can test the changes with the latest from smartclient.com/builds.

      Comment

      Working...
      X