Package com.smartgwt.client.widgets.calendar

Examples of com.smartgwt.client.widgets.calendar.Calendar


        eventDS.setFields(eventIdField, nameField, descField, startDateField, endDateField);
        eventDS.setClientOnly(true);
        eventDS.setTestData(CalendarData.getRecords());

        Calendar calendar = new Calendar();
        calendar.setShowWeekends(false);
        calendar.setShowWorkday(true);
        calendar.setScrollToWorkday(true);
        calendar.setDataSource(eventDS);
        calendar.setAutoFetchData(true);

        return calendar;
    }
View Full Code Here


        eventDS.setFields(eventIdField, nameField, descField, startDateField, endDateField);
        eventDS.setClientOnly(true);
        eventDS.setTestData(CalendarData.getRecords());

        Calendar calendar = new Calendar() {
            @Override
            protected String getDayBodyHTML(Date date, CalendarEvent[] events, Calendar calendar, int rowNum, int colNum) {
                String returnStr = date.getDate() + "";
                if(events != null && events.length > 0) {
                    returnStr += imgHTML("icons/16/approved.png", 16, 16, "image", "style='margin-top:6px'", null);
                }
                return returnStr;
            }
        };

        calendar.setWidth(500);
        calendar.setHeight(220);
        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.setDataSource(eventDS);
        calendar.setAutoFetchData(true);
        calendar.addDayBodyClickHandler(new DayBodyClickHandler() {
            public void onDayBodyClick(DayBodyClickEvent event) {
                String nameStr = "";
                CalendarEvent[] events = event.getEvents();
                if(events.length == 0) {
                    nameStr = "No events";
View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        Calendar calendar = new Calendar();
        //use 24 hr based times
        calendar.setTimeFormatter(TimeFormatter.TOSHORT24HOURTIME);

        //use european based DD/MM/YYYY date formats
        calendar.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATE);
        calendar.setData(CalendarData.getRecords());
        return calendar;
    }
View Full Code Here

        eventDS.setFields(eventIdField, nameField, descField, startDateField, endDateField);
        eventDS.setClientOnly(true);
        eventDS.setTestData(CalendarData.getRecords());

        Calendar calendar = new Calendar();
        calendar.setDataSource(eventDS);
        calendar.setAutoFetchData(true);

        //specify the last field from the default fields so that subsequent fields come after the
        //default fields
        TextItem descItem = new TextItem();
        descItem.setName("description");

        //custom fields below
        HeaderItem eventOptions = new HeaderItem();
        eventOptions.setDefaultValue("Event Options");

        SelectItem repeatsItem = new SelectItem();
        repeatsItem.setName("repeats");
        repeatsItem.setTitle("Repeats");
        repeatsItem.setColSpan(4);
        repeatsItem.setDefaultToFirstOption(true);
        repeatsItem.setValueMap("Does not repeat", "Daily", "Weekly", "Monthly", "Yearly");

        SelectItem reminderItem = new SelectItem();
        reminderItem.setName("reminderType");
        reminderItem.setTitle("Reminder");
        reminderItem.setWidth(70);
        reminderItem.setDefaultToFirstOption(true);
        reminderItem.setValueMap("Pop-up", "Email");

        TextItem reminderValue = new TextItem();
        reminderValue.setName("reminderValue");
        reminderValue.setShowTitle(false);
        reminderValue.setWidth(60);
        reminderValue.setDefaultValue(10);

        SelectItem reminderUnits = new SelectItem();
        reminderUnits.setName("reminderUnits");
        reminderUnits.setShowTitle(false);
        reminderUnits.setWidth(70);
        reminderUnits.setDefaultToFirstOption(false);
        reminderUnits.setValueMap("minutes", "hours", "days");

        calendar.setEventEditorFields(descItem, eventOptions, repeatsItem, reminderItem, reminderValue, reminderUnits);

        TextItem nameItem = new TextItem();
        nameItem.setType("text");
        nameItem.setName("name");

        RadioGroupItem radioGroupItem = new RadioGroupItem("sharing");
        radioGroupItem.setTitle("Sharing");
        radioGroupItem.setVertical(false);
        radioGroupItem.setValueMap("Public", "Private");
        radioGroupItem.setWidth(50);
       
        calendar.setEventDialogFields(nameItem, radioGroupItem);

        return calendar;
    }
View Full Code Here

        eventDS.setFields(eventIdField, nameField, descField, startDateField, endDateField);
        eventDS.setClientOnly(true);
        eventDS.setTestData(CalendarData.getRecords());

        Calendar calendar = new Calendar();
        calendar.setDataSource(eventDS);
        calendar.setAutoFetchData(true);

        return calendar;
    }
View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        Calendar calendar = new Calendar();
        calendar.setData(CalendarOverlappingData.getRecords());

        //the following are the Calendar's defaults and would still have been set without this code
        calendar.setEventAutoArrange(true);
        calendar.setEventOverlap(false);
        return calendar;
    }
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        Calendar calendar = new Calendar();
        calendar.setData(CalendarOverlappingData.getRecords());
        calendar.setAutoFetchData(true);

        //the following are the Calendar's defaults and would still have been set without this code
        calendar.setEventAutoArrange(true);
        calendar.setEventOverlap(true);
        calendar.setEventOverlapPercent(10);
        calendar.setEventOverlapIdenticalStartTimes(false);
        return calendar;
    }
View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        Calendar calendar = new Calendar();
        calendar.setData(CalendarData.getRecords());
        return calendar;
    }
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.calendar.Calendar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.