Announcement

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

    Calendar widget (Month view) need the number of rows.

    I'm using the Calendar widget as a navigational component to select date ranges for reports in another canvas. I need to implement buttons on the side of the month view of the calendar to be able to select an entire week.

    My problem is this, I need a way that I can identify which days within the currently displayed month fall into a given row on the month view of the calendar.

    The Calendar class provides a protected method getDayBodyHTML() which provides the means to setup what's shown in each day cell, and this method passes in rowNum & colNum, so these values are held within the Calendar object.

    How can I access these values, and get a collection of days that would fall into a given row?

    The code I'm using to set up my Calendar is as follows:
    Code:
            // Create a calendar object and fill it with some data..
    		smartGwtCalendar = new Calendar(){
    			@Override
    			protected String getDayBodyHTML(Date date, CalendarEvent[] events, Calendar calendar, int rowNum, int colNum) {
    				return date.getDate()+"";
    			}  
    
    		};  
    		
    		RecordList recordList = new RecordList();
    		smartGwtCalendar.setData(recordList);
    		
    		smartGwtCalendar.setCurrentViewName(ViewName.MONTH);
    		smartGwtCalendar.setWidth(180);  
    		smartGwtCalendar.setHeight(220);  
    		smartGwtCalendar.setShowDayView(false);  
    		smartGwtCalendar.setShowWeekView(false);  
    		smartGwtCalendar.setShowOtherDays(false);  
    		smartGwtCalendar.setShowDayHeaders(false);  
    		smartGwtCalendar.setShowDatePickerButton(false);  
    		smartGwtCalendar.setShowAddEventButton(false);  
    		smartGwtCalendar.setDisableWeekends(false);          
    		smartGwtCalendar.setShowDateChooser(false);  
    		smartGwtCalendar.setCanCreateEvents(false);
Working...
X