|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.smartgwt.client.widgets.BaseWidget
com.smartgwt.client.widgets.Canvas
com.smartgwt.client.widgets.calendar.Calendar
public class Calendar
The Calendar component provides several different ways for a user to view and edit a set of events. Note that the ISC_Calendar.js module must be loaded to make use of the Calendar class.
CalendarEvents
Events
are represented as ordinary JavaScript Objects (see CalendarEvent
). The
Calendar expects to be able to read and write a basic set of properties on events: name, startDate, endDate,
description, etc, which can be stored under configurable property names (see eg startDateField
.
Much like a ListGrid
manages it's ListGridRecords, the Calendar can either be passed an ordinary
Array of CalendarEvents or can fetch data from a DataSource.
If the calendar is bound to a DataSource, event changes by user action or by calling methods will be saved to the DataSource.
Navigation
The calendar
supports a WeekView
, DayView
and MonthView
by default. The user can navigate using back and
forward buttons or via an attached DateChooser
.
Event Manipulation
Events can be created via clicking on the day, week or month views, or via the "Add Event" button. In the day and week views, the user may click and drag to create an event of a specific duration.
Creating an event via click or click and drag pops up the EventDialog
, which provides a simple form for quick event
entry (only one field, the description, is required by default).
A separate editor called the EventEditor
provides an interface for editing all
possible properties of an event, including custom properties. The EventEditor is used whenever a pre-existing event is
being edited, and can also be invoked by the user wherever the simpler EventDialog appears.
Events can also be
programmatically added
, removed
, or updated
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
---|
config, configOnly, id, isElementSet, nativeObject, scClassName |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
Calendar()
|
|
Calendar(JavaScriptObject jsObj)
|
Method Summary | |
---|---|
HandlerRegistration |
addBackgroundClickHandler(BackgroundClickHandler handler)
Add a backgroundClick handler. |
HandlerRegistration |
addBackgroundMouseDownHandler(BackgroundMouseDownHandler handler)
Add a backgroundMouseDown handler. |
HandlerRegistration |
addDateChangedHandler(DateChangedHandler handler)
Add a dateChanged handler. |
HandlerRegistration |
addDayBodyClickHandler(DayBodyClickHandler handler)
Add a dayBodyClick handler. |
HandlerRegistration |
addDayHeaderClickHandler(DayHeaderClickHandler handler)
Add a dayHeaderClick handler. |
HandlerRegistration |
addDragCompleteHandler(DragCompleteHandler handler)
Add a com.smartgwt.client.widgets.DragCompleteHandler . |
HandlerRegistration |
addDropCompleteHandler(DropCompleteHandler handler)
Add a com.smartgwt.client.widgets.DropCompleteHandler . |
void |
addEvent(Date startDate,
Date endDate,
String name,
String description)
Create a new event in this calendar instance. |
void |
addEvent(Date startDate,
Date endDate,
String name,
String description,
Map otherFields)
Create a new event in this calendar instance. |
HandlerRegistration |
addEventAddedHandler(EventAddedHandler handler)
Add a eventAdded handler. |
HandlerRegistration |
addEventChangedHandler(EventChangedHandler handler)
Add a eventChanged handler. |
HandlerRegistration |
addEventClickHandler(EventClickHandler handler)
Add a eventClick handler. |
HandlerRegistration |
addEventMovedHandler(EventMovedHandler handler)
Add a eventMoved handler. |
HandlerRegistration |
addEventRemoveClickHandler(EventRemoveClickHandler handler)
Add a eventRemoveClick handler. |
HandlerRegistration |
addEventRemovedHandler(EventRemovedHandler handler)
Add a eventRemoved handler. |
HandlerRegistration |
addEventResizedHandler(EventResizedHandler handler)
Add a eventResized handler. |
HandlerRegistration |
addFetchDataHandler(FetchDataHandler handler)
Add a fetchData handler. |
void |
addFormulaField()
Convenience method to display a com.smartgwt.client..FormulaBuilder to create a new Formula Field. |
void |
addLane(Lane lane)
Adds a new Lane to the calendar in timelineView mode. |
void |
addSummaryField()
Convenience method to display a com.smartgwt.client..SummaryBuilder to create a new Summary Field. |
Boolean |
anySelected()
Whether at least one item is selected |
static boolean |
calendarLoaded()
Static method indicating whether the optional Calendar module is loaded for the page. |
protected JavaScriptObject |
create()
|
Boolean |
dateIsWorkday(Date date)
Should the parameter date be considered a workday? By default this method tries to find the parameter date day in workdays , and returns true if found. |
void |
deselectAllRecords()
Deselect all records |
void |
deselectRecord(int record)
Deselect a Record passed in explicitly, or by index. |
void |
deselectRecord(Record record)
Deselect a Record passed in explicitly, or by index. |
void |
deselectRecords(int[] records)
Deselect a list of Record s passed in explicitly, or by index. |
void |
deselectRecords(Record[] records)
Deselect a list of Record s passed in explicitly, or by index. |
void |
disableHilite(String hiliteID)
Disable a hilite |
void |
disableHiliting()
Disable all hilites. |
void |
editHilites()
Shows a HiliteEditor interface allowing end-users to edit the data-hilites currently in use by this DataBoundComponent. |
void |
enableHilite(String hiliteID)
Enable / disable a hilites
|
void |
enableHilite(String hiliteID,
boolean enable)
Enable / disable a hilites
|
void |
enableHiliting()
Enable all hilites. |
void |
enableHiliting(boolean enable)
Enable all hilites. |
void |
eventsRendered()
A notification method fired when the events in the current view have been refreshed. |
void |
exportClientData()
Exports this component's data with client-side formatters applied, so is suitable for direct display to users. |
void |
exportClientData(DSRequest requestProperties)
Exports this component's data with client-side formatters applied, so is suitable for direct display to users. |
void |
exportData()
Uses a "fetch" operation on the current DataSource
to retrieve data that matches the current filter and sort criteria for this component, then exports the resulting data
to a file or window in the requested format. |
void |
exportData(DSRequest requestProperties)
Uses a "fetch" operation on the current DataSource
to retrieve data that matches the current filter and sort criteria for this component, then exports the resulting data
to a file or window in the requested format. |
void |
fetchData()
Retrieves data from the DataSource that matches the specified criteria. |
void |
fetchData(Criteria criteria)
Retrieves data from the DataSource that matches the specified criteria. |
void |
fetchData(Criteria criteria,
DSCallback callback)
Retrieves data from the DataSource that matches the specified criteria. |
void |
fetchData(Criteria criteria,
DSCallback callback,
DSRequest requestProperties)
Retrieves data from the DataSource that matches the specified criteria. |
void |
filterData()
Retrieves data that matches the provided criteria and displays the matching data in this component. |
void |
filterData(Criteria criteria)
Retrieves data that matches the provided criteria and displays the matching data in this component. |
void |
filterData(Criteria criteria,
DSCallback callback)
Retrieves data that matches the provided criteria and displays the matching data in this component. |
void |
filterData(Criteria criteria,
DSCallback callback,
DSRequest requestProperties)
Retrieves data that matches the provided criteria and displays the matching data in this component. |
int |
getActiveDay()
Gets the day of the week (0-6) that the mouse is currently over. |
Date |
getActiveTime()
Gets a date object representing the date over which the mouse is hovering for the current selected view. |
Boolean |
getAddDropValues()
Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key. |
String |
getAddEventButtonHoverText()
The text to be displayed when a user hovers over the add event toolbar button |
String |
getAddFormulaFieldText()
Text for a menu item allowing users to add a formula field |
String |
getAddOperation()
Operation ID this component should use when performing add operations. |
String |
getAddSummaryFieldText()
Text for a menu item allowing users to add a formula field |
Boolean |
getAutoFetchAsFilter()
If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData() |
Boolean |
getAutoFetchData()
If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on
DataBoundComponent.getAutoFetchAsFilter() . |
TextMatchStyle |
getAutoFetchTextMatchStyle()
If autoFetchData is true , this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData() call. |
String |
getBaseStyle()
The base name for the CSS class applied to the grid cells of the day and week views of the calendar. |
Boolean |
getCanAddFormulaFields()
Adds an item to the header context menu allowing users to launch a dialog to define a new field based on values present in other fields, using the com.smartgwt.client..FormulaBuilder .
|
Boolean |
getCanAddSummaryFields()
Adds an item to the header context menu allowing users to launch a dialog to define a new text field that can contain both user-defined text and the formatted values present in other fields, using the com.smartgwt.client..SummaryBuilder .
|
String |
getCancelButtonTitle()
The title for the cancel button in the event editor |
Boolean |
getCanCreateEvents()
If true, users can create new events |
Boolean |
getCanDeleteEvents()
If true, users can delete existing events. |
String |
getCanDragEventField()
Name of the field on each CalendarEvent that determines dragability. |
Boolean |
getCanDragEvents()
If true, users can drag-reposition existing events. |
Boolean |
getCanEditEvents()
If true, users can edit existing events |
String |
getCanEditField()
Name of the field on each CalendarEvent that determines editability. |
Boolean |
getCanEditLane()
Can we edit the lane of the event, specified by the laneNameField ? If so, the event can be dragged to a
different lane and, when it's editor is shown, an
additional drop-down widget is provided allowing the user to select a different lane. |
Boolean |
getCanResizeTimelineEvents()
Can timeline events be stretched by their left and right edges? |
Date |
getChosenDate()
The date for which events are displayed in the day, week, and month tabs of the calendar. |
ViewName |
getCurrentViewName()
The name of the view that should be visible initially by default. |
CalendarEvent[] |
getData()
|
FetchMode |
getDataFetchMode()
How to fetch and manage records retrieve from the server. |
int |
getDataPageSize()
When using data paging, how many records to fetch at a time. |
DataSource |
getDataSource()
The DataSource that this component should bind to for default fields and for performing DataSource requests . |
DateEditingStyle |
getDateEditingStyle()
Indicates the type of controls to use in event-windows. |
DateDisplayFormat |
getDateFormatter()
Date formatter for displaying events. |
String |
getDatePickerHoverText()
The text to be displayed when a user hovers over the date picker toolbar button |
String |
getDayBodyBaseStyle()
The base name for the CSS class applied to the day body of the month view of the calendar. |
protected String |
getDayBodyHTML(Date date,
CalendarEvent[] events,
Calendar calendar,
int rowNum,
int colNum)
|
String |
getDayHeaderBaseStyle()
The base name for the CSS class applied to the day headers of the month view. |
String |
getDayViewTitle()
The title for the day view |
String |
getDescriptionField()
The name of the description field in a CalendarEvent . |
String |
getDetailsButtonTitle()
The title for the edit button in the quick event dialog |
Boolean |
getDisableWeekends()
If set, weekend days appear in disabled style and events cannot be created on weekends. |
Record[] |
getDragData()
During a drag-and-drop interaction, this method returns the set of records being dragged out of the component. |
DragDataAction |
getDragDataAction()
Indicates what to do with data dragged into another DataBoundComponent. |
String |
getDragTrackerStyle()
CSS Style to apply to the drag tracker when dragging occurs on this component. |
Map |
getDropValues()
When an item is dropped on this component, and addDropValues is true and both the source and
target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key, this object provides the "drop values" that
Smart GWT will apply to the dropped object before updating it. |
String |
getDuplicateDragMessage()
Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates
is enabled. |
String |
getEditFormulaFieldText()
Text for a menu item allowing users to edit a formula field |
String |
getEditSummaryFieldText()
Text for a menu item allowing users to edit the formatter for a field |
Date |
getEndDate()
The end date of the calendar timeline view. |
String |
getEndDateField()
The name of the end date field in a CalendarEvent . |
Boolean |
getEventAutoArrange()
If set to true, enables the auto-arrangement of events that share time in the calendar. |
int |
getEventDragGap()
The number of pixels to leave to the right of events so overlapping events can still be added using the mouse. |
String |
getEventNameFieldTitle()
The title for the event name field in the quick event dialog |
Boolean |
getEventOverlap()
When eventAutoArrange is true, setting
eventOverlap to true causes events that share timeslots to overlap each other by a percentage of their width, specified
by eventOverlapPercent . |
Boolean |
getEventOverlapIdenticalStartTimes()
When set to true, events that start at the same time will not overlap each other to prevent events having their close button hidden. |
int |
getEventOverlapPercent()
The size of the overlap, presented as a percentage of the width of events sharing timeslots. |
int |
getEventSnapGap()
Determines how many minutes an event can be moved or resized by. |
String |
getEventWindowStyle()
The base name for the CSS class applied to event windows within calendars. |
String |
getEventWindowStyleField()
The name of the field used to override eventWindowStyle for an individual CalendarEvent . |
Boolean |
getExportAll()
Setting exportAll to true prevents the component from passing its list of fields to the export call. |
String[] |
getExportFields()
The list of field-names to export. |
String |
getFetchOperation()
Operation ID this component should use when performing fetch operations. |
int |
getFirstDayOfWeek()
The numeric day (0-6) which the calendar should consider as the first day of the week |
HeaderLevel[] |
getHeaderLevels()
Configures the levels of headers shown above the event area,
and their time units. |
String |
getHiliteProperty()
Marker that can be set on a record to flag that record as hilited. |
Hilite[] |
getHilites()
Return the set of hilite-objects currently applied to this DataBoundComponent. |
String |
getHiliteState()
Get the current hilites encoded as a String, for saving. |
Criteria |
getInitialCriteria()
Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used. |
Boolean |
getInvalidDateMessage()
The message to display in the eventEditor when the
'To' date is greater than the 'From' date and a save is attempted. |
ListGridField[] |
getLaneFields()
|
String |
getLaneNameField()
The name of the field which will determine the lane in
which this event will be displayed for the timelineView |
Lane[] |
getLanes()
|
String |
getLeadingDateField()
The name of the leading date field for each event. |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
getLogicalStructure()
|
String |
getMonthViewTitle()
The title for the month view |
String |
getNameField()
The name of the name field in a CalendarEvent . |
String |
getNextButtonHoverText()
The text to be displayed when a user hovers over the next toolbar button |
static Calendar |
getOrCreateRef(JavaScriptObject jsObj)
|
String |
getOtherDayBlankStyle()
In the month CSS style applied to both the header and body of days from other months when showOtherDays is false. |
String |
getOtherDayBodyBaseStyle()
The base name for the CSS class applied to the day body of the month view of the calendar. |
String |
getOtherDayHeaderBaseStyle()
The base name for the CSS class applied to the day headers of the month view. |
Date |
getPeriodEndDate()
Returns the end of the selected week or month depending on the current calendar view. |
Date |
getPeriodStartDate()
Returns the start of the selected week or month depending on the current calendar view. |
Boolean |
getPreventDuplicates()
If set, detect and prevent duplicate records from being transferred to this component, either via drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent) . |
String |
getPreviousButtonHoverText()
The text to be displayed when a user hovers over the previous toolbar button |
int |
getRecordIndex(Record record)
Get the index of the provided record. |
RecordList |
getRecordList()
Return the underlying data of this DataBoundComponent as a RecordList . |
String |
getRemoveOperation()
Operation ID this component should use when performing remove operations. |
ResultSet |
getResultSet()
Return the underlying data of this DataBoundComponent as a ResultSet . |
int |
getRowHeight()
The height of time-slots in the calendar. |
String |
getSaveButtonTitle()
The title for the save button in the quick event dialog and the event editor |
Boolean |
getScrollToWorkday()
If set, causes the workday hours to be sized to
fill the available space in the day view and week view, and automatically scrolls these views to the start of the
workday when the calendar is first displayed and whenever the user switches to a new day or week. |
String |
getSelectedCellStyle()
The base name for the CSS class applied to a cell that is selected via a mouse drag. |
Boolean |
getShowComplexFields()
Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no component.fields .
|
Boolean |
getShowControlsBar()
If false the controls bar at the top of the calendar will not be displayed. |
Boolean |
getShowDateChooser()
Determines whether the dateChooser is displayed. |
Boolean |
getShowDayHeaders()
If false, the month view does not show day headers |
Boolean |
getShowDetailFields()
Whether to show fields marked detail:true when a DataBoundComponent is given a DataSource but no
component.fields . |
Boolean |
getShowEventDescriptions()
If false, the event header will take up the entire space of the event. |
Boolean |
getShowHiddenFields()
Whether to show fields marked hidden:true when a DataBoundComponent is given a
DataSource but no component.fields .
|
Boolean |
getShowOtherDays()
If set to true, in the month view, days that fall in an adjacent month are still shown with a header and body area, and are interactive. |
Boolean |
getShowQuickEventDialog()
Determines whether the quick event dialog is displayed when a time is clicked. |
Boolean |
getShowTimelineView()
If set to true, show the Timeline view. |
Boolean |
getShowWeekends()
Suppresses the display of weekend days in the week and month views, and disallows the creation of events on weekends. |
Boolean |
getShowWorkday()
If set, causes the calendar to use workdayBaseStyle for cells falling within the workday as defined by workdayStart and workdayEnd , in both the weekView and dayView . |
Boolean |
getSizeEventsToGrid()
If true, events will be sized to the grid, even if they start and/or end at times between grid cells. |
Date |
getStartDate()
The start date of the calendar timeline view . |
String |
getStartDateField()
The name of the start date field in a CalendarEvent . |
TimeDisplayFormat |
getTimeFormatter()
Display format to use for the time portion of events' date information. |
TimeUnit |
getTimelineGranularity()
The granularity with which the timelineView will display events. |
int |
getTimelineUnitsPerColumn()
How many units of timelineGranularity each
cell represents. |
String |
getTimelineViewTitle()
The title for the timeline view |
String |
getTitleField()
Method to return the fieldName which represents the "title" for records in this Component. If this.titleField is explicitly specified it will always be used. Otherwise, default implementation will check titleField for databound
components.For non databound components returns the first defined field name of "title" ,
"name" , or "id" . |
String |
getTitleFieldValue(Record record)
Get the value of the titleField for the passed record |
String |
getTodayBackgroundColor()
The background color for today when +{timelineGranularity} is "day" |
String |
getTrailingDateField()
The name of the trailing date field for each event. |
String |
getUpdateOperation()
Operation ID this component should use when performing update operations. |
Boolean |
getUseAllDataSourceFields()
If true, the set of fields given by the "default binding" (see fields ) is used, with any fields specified in
component.fields acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
|
Boolean |
getUseFlatFields()
The useFlatFields flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding. |
Date |
getVisibleEndDate()
Returns the last visible date in the currently selected calendar view. |
Date |
getVisibleStartDate()
Returns the first visible date in the currently selected calendar view. |
Boolean |
getWeekEventBorderOverlap()
Augments the width of week event windows slightly to avoid duplicate adjacent borders between events. |
String |
getWeekViewTitle()
The title for the week view |
String |
getWorkdayBaseStyle()
If showWorkday is set, style used for cells that
are within the workday, as defined by workdayStart
and workdayEnd . |
String |
getWorkdayEnd()
When using showWorkday :true,
workdayStart and workdayEnd specify the time of day when the workday starts and ends,
specified as a String acceptable to String. |
String |
getWorkdayStart()
When using showWorkday :true,
workdayStart and workdayEnd specify the time of day when the workday starts and ends,
specified as a String acceptable to String. |
void |
invalidateCache()
Invalidate the current data cache for this databound component via a call to this.data.invalidateCache() . |
void |
next()
Move to the next day, week, or month, depending on which tab is selected. |
protected void |
onInit_Calendar()
|
protected void |
onInit()
|
void |
previous()
Move to the previous day, week, or month, depending on which tab is selected. |
void |
removeEvent(CalendarEvent event)
Remove an event from this calendar. |
void |
removeLane(Lane lane)
Removes a lane from the calendar in timelineView
mode. |
void |
removeLane(String laneName)
Removes a lane from the calendar in timelineView
mode. |
void |
selectAllRecords()
Select all records |
void |
selectRecord(int record)
Select/deselect a Record passed in explicitly, or by index. |
void |
selectRecord(int record,
boolean newState)
Select/deselect a Record passed in explicitly, or by index. |
void |
selectRecord(Record record)
Select/deselect a Record passed in explicitly, or by index. |
void |
selectRecord(Record record,
boolean newState)
Select/deselect a Record passed in explicitly, or by index. |
void |
selectRecords(int[] records)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectRecords(int[] records,
boolean newState)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectRecords(Record[] records)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectRecords(Record[] records,
boolean newState)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectTab(int tabnum)
Fires whenever the user changes the current date, including picking a specific date or navigating to a new week or month. |
void |
setAddDropValues(Boolean addDropValues)
Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key. |
void |
setAddEventButtonHoverText(String addEventButtonHoverText)
The text to be displayed when a user hovers over the add event toolbar button |
void |
setAddFormulaFieldText(String addFormulaFieldText)
Text for a menu item allowing users to add a formula field |
void |
setAddOperation(String addOperation)
Operation ID this component should use when performing add operations. |
void |
setAddSummaryFieldText(String addSummaryFieldText)
Text for a menu item allowing users to add a formula field |
void |
setAutoFetchAsFilter(Boolean autoFetchAsFilter)
If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData() |
void |
setAutoFetchData(Boolean autoFetchData)
If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on
DataBoundComponent.getAutoFetchAsFilter() . |
void |
setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle)
If autoFetchData is true , this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData() call. |
void |
setBaseStyle(String baseStyle)
The base name for the CSS class applied to the grid cells of the day and week views of the calendar. |
void |
setCanAddFormulaFields(Boolean canAddFormulaFields)
Adds an item to the header context menu allowing users to launch a dialog to define a new field based on values present in other fields, using the com.smartgwt.client..FormulaBuilder .
|
void |
setCanAddSummaryFields(Boolean canAddSummaryFields)
Adds an item to the header context menu allowing users to launch a dialog to define a new text field that can contain both user-defined text and the formatted values present in other fields, using the com.smartgwt.client..SummaryBuilder .
|
void |
setCancelButtonTitle(String cancelButtonTitle)
The title for the cancel button in the event editor |
void |
setCanCreateEvents(Boolean canCreateEvents)
If true, users can create new events |
void |
setCanDeleteEvents(Boolean canDeleteEvents)
If true, users can delete existing events. |
void |
setCanDragEventField(String canDragEventField)
Name of the field on each CalendarEvent that determines dragability. |
void |
setCanDragEvents(Boolean canDragEvents)
If true, users can drag-reposition existing events. |
void |
setCanEditEvents(Boolean canEditEvents)
If true, users can edit existing events |
void |
setCanEditField(String canEditField)
Name of the field on each CalendarEvent that determines editability. |
void |
setCanEditLane(Boolean canEditLane)
Can we edit the lane of the event, specified by the laneNameField ? If so, the event can be dragged to a
different lane and, when it's editor is shown, an
additional drop-down widget is provided allowing the user to select a different lane. |
void |
setCanResizeTimelineEvents(Boolean canResizeTimelineEvents)
Can timeline events be stretched by their left and right edges? |
void |
setChosenDate(Date chosenDate)
The date for which events are displayed in the day, week, and month tabs of the calendar. |
void |
setCurrentViewName(ViewName currentViewName)
The name of the view that should be visible initially by default. |
void |
setData(CalendarEvent[] data)
A List of CalendarEvent objects, specifying the data to be used to populate the calendar. |
void |
setData(Record[] data)
An array of Record objects, specifying the data to be used to populate the DataBoundComponent. |
void |
setData(RecordList data)
An List of Record objects, specifying the data to be used to populate the DataBoundComponent. |
void |
setDataFetchMode(FetchMode dataFetchMode)
How to fetch and manage records retrieve from the server. |
void |
setDataPageSize(int dataPageSize)
When using data paging, how many records to fetch at a time. |
void |
setDataSource(DataSource dataSource)
Bind to a DataSource. |
void |
setDateEditingStyle(DateEditingStyle dateEditingStyle)
Indicates the type of controls to use in event-windows. |
void |
setDateFormatter(DateDisplayFormat dateFormatter)
Date formatter for displaying events. |
void |
setDatePickerHoverText(String datePickerHoverText)
The text to be displayed when a user hovers over the date picker toolbar button |
void |
setDayBodyBaseStyle(String dayBodyBaseStyle)
The base name for the CSS class applied to the day body of the month view of the calendar. |
void |
setDayHeaderBaseStyle(String dayHeaderBaseStyle)
The base name for the CSS class applied to the day headers of the month view. |
void |
setDayViewTitle(String dayViewTitle)
The title for the day view |
static void |
setDefaultProperties(Calendar calendarProperties)
Class level method to set the default properties of this class. |
void |
setDescriptionField(String descriptionField)
The name of the description field in a CalendarEvent . |
void |
setDetailsButtonTitle(String detailsButtonTitle)
The title for the edit button in the quick event dialog |
void |
setDisableWeekends(Boolean disableWeekends)
If set, weekend days appear in disabled style and events cannot be created on weekends. |
void |
setDragDataAction(DragDataAction dragDataAction)
Indicates what to do with data dragged into another DataBoundComponent. |
void |
setDragTrackerStyle(String dragTrackerStyle)
CSS Style to apply to the drag tracker when dragging occurs on this component. |
void |
setDropValues(Map dropValues)
When an item is dropped on this component, and addDropValues is true and both the source and
target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key, this object provides the "drop values" that
Smart GWT will apply to the dropped object before updating it. |
void |
setDuplicateDragMessage(String duplicateDragMessage)
Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates
is enabled. |
void |
setEditFormulaFieldText(String editFormulaFieldText)
Text for a menu item allowing users to edit a formula field |
void |
setEditSummaryFieldText(String editSummaryFieldText)
Text for a menu item allowing users to edit the formatter for a field |
void |
setEndDate(Date endDate)
The end date of the calendar timeline view. |
void |
setEndDateField(String endDateField)
The name of the end date field in a CalendarEvent . |
void |
setEventAutoArrange(Boolean eventAutoArrange)
If set to true, enables the auto-arrangement of events that share time in the calendar. |
void |
setEventDialogFields(FormItem... eventDialogFields)
The set of fields for the eventDialog . |
void |
setEventDragGap(int eventDragGap)
The number of pixels to leave to the right of events so overlapping events can still be added using the mouse. |
void |
setEventEditorFields(FormItem... eventEditorFields)
The set of fields for the eventEditor . |
void |
setEventNameFieldTitle(String eventNameFieldTitle)
The title for the event name field in the quick event dialog |
void |
setEventOverlap(Boolean eventOverlap)
When eventAutoArrange is true, setting
eventOverlap to true causes events that share timeslots to overlap each other by a percentage of their width, specified
by eventOverlapPercent . |
void |
setEventOverlapIdenticalStartTimes(Boolean eventOverlapIdenticalStartTimes)
When set to true, events that start at the same time will not overlap each other to prevent events having their close button hidden. |
void |
setEventOverlapPercent(int eventOverlapPercent)
The size of the overlap, presented as a percentage of the width of events sharing timeslots. |
void |
setEventSnapGap(int eventSnapGap)
Determines how many minutes an event can be moved or resized by. |
void |
setEventWindowStyle(String eventWindowStyle)
The base name for the CSS class applied to event windows within calendars. |
void |
setEventWindowStyleField(String eventWindowStyleField)
The name of the field used to override eventWindowStyle for an individual CalendarEvent . |
void |
setExportAll(Boolean exportAll)
Setting exportAll to true prevents the component from passing its list of fields to the export call. |
void |
setExportFields(String[] exportFields)
The list of field-names to export. |
void |
setFetchOperation(String fetchOperation)
Operation ID this component should use when performing fetch operations. |
void |
setFirstDayOfWeek(int firstDayOfWeek)
The numeric day (0-6) which the calendar should consider as the first day of the week |
void |
setHeaderLevels(HeaderLevel... headerLevels)
Configures the levels of headers shown above the event area,
and their time units. |
void |
setHiliteProperty(String hiliteProperty)
Marker that can be set on a record to flag that record as hilited. |
void |
setHilites(Hilite[] hilites)
Accepts an array of hilite objects and applies them to this DataBoundComponent. |
void |
setHiliteState(String hiliteState)
Set the current hilites based on a hiliteState String previously returned from getHilitesState. |
void |
setInitialCriteria(Criteria initialCriteria)
Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used. |
void |
setInvalidDateMessage(Boolean invalidDateMessage)
The message to display in the eventEditor when the
'To' date is greater than the 'From' date and a save is attempted. |
void |
setJavaScriptObject(JavaScriptObject jsObj)
|
void |
setLaneFields(ListGridField... laneFields)
Sets the frozen timeline laneFields for this calendar |
void |
setLaneNameField(String laneNameField)
The name of the field which will determine the lane in
which this event will be displayed for the timelineView |
void |
setLanes(Lane... lanes)
Sets the timeline lanes for this calendar |
void |
setLeadingDateField(String leadingDateField)
The name of the leading date field for each event. |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
setLogicalStructure(com.smartgwt.logicalstructure.widgets.calendar.CalendarLogicalStructure s)
|
void |
setMonthViewTitle(String monthViewTitle)
The title for the month view |
void |
setNameField(String nameField)
The name of the name field in a CalendarEvent . |
void |
setNextButtonHoverText(String nextButtonHoverText)
The text to be displayed when a user hovers over the next toolbar button |
void |
setOtherDayBlankStyle(String otherDayBlankStyle)
In the month CSS style applied to both the header and body of days from other months when showOtherDays is false. |
void |
setOtherDayBodyBaseStyle(String otherDayBodyBaseStyle)
The base name for the CSS class applied to the day body of the month view of the calendar. |
void |
setOtherDayHeaderBaseStyle(String otherDayHeaderBaseStyle)
The base name for the CSS class applied to the day headers of the month view. |
void |
setPreventDuplicates(Boolean preventDuplicates)
If set, detect and prevent duplicate records from being transferred to this component, either via drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent) . |
void |
setPreviousButtonHoverText(String previousButtonHoverText)
The text to be displayed when a user hovers over the previous toolbar button |
void |
setRemoveOperation(String removeOperation)
Operation ID this component should use when performing remove operations. |
void |
setRowHeight(int rowHeight)
The height of time-slots in the calendar. |
void |
setSaveButtonTitle(String saveButtonTitle)
The title for the save button in the quick event dialog and the event editor |
void |
setScrollToWorkday(Boolean scrollToWorkday)
If set, causes the workday hours to be sized to
fill the available space in the day view and week view, and automatically scrolls these views to the start of the
workday when the calendar is first displayed and whenever the user switches to a new day or week. |
void |
setSelectedCellStyle(String selectedCellStyle)
The base name for the CSS class applied to a cell that is selected via a mouse drag. |
void |
setShowAddEventButton(Boolean showAddEventButton)
|
void |
setShowComplexFields(Boolean showComplexFields)
Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no component.fields .
|
void |
setShowControlsBar(Boolean showControlsBar)
If false the controls bar at the top of the calendar will not be displayed. |
void |
setShowDateChooser(Boolean showDateChooser)
Determines whether the dateChooser is displayed. |
void |
setShowDatePickerButton(Boolean showDatePickerButton)
|
void |
setShowDayHeaders(Boolean showDayHeaders)
If false, the month view does not show day headers |
void |
setShowDayView(Boolean showDayView)
|
void |
setShowDetailFields(Boolean showDetailFields)
Whether to show fields marked detail:true when a DataBoundComponent is given a DataSource but no
component.fields . |
void |
setShowEventDescriptions(Boolean showEventDescriptions)
If false, the event header will take up the entire space of the event. |
void |
setShowHiddenFields(Boolean showHiddenFields)
Whether to show fields marked hidden:true when a DataBoundComponent is given a
DataSource but no component.fields .
|
void |
setShowMonthView(Boolean showMonthView)
|
void |
setShowOtherDays(Boolean showOtherDays)
If set to true, in the month view, days that fall in an adjacent month are still shown with a header and body area, and are interactive. |
void |
setShowQuickEventDialog(Boolean showQuickEventDialog)
Determines whether the quick event dialog is displayed when a time is clicked. |
void |
setShowTimelineView(Boolean showTimelineView)
If set to true, show the Timeline view. |
void |
setShowWeekends(Boolean showWeekends)
Suppresses the display of weekend days in the week and month views, and disallows the creation of events on weekends. |
void |
setShowWeekView(Boolean showWeekView)
|
void |
setShowWorkday(Boolean showWorkday)
If set, causes the calendar to use workdayBaseStyle for cells falling within the workday as defined by workdayStart and workdayEnd , in both the weekView and dayView . |
void |
setSizeEventsToGrid(Boolean sizeEventsToGrid)
If true, events will be sized to the grid, even if they start and/or end at times between grid cells. |
void |
setStartDate(Date startDate)
The start date of the calendar timeline view . |
void |
setStartDateField(String startDateField)
The name of the start date field in a CalendarEvent . |
void |
setTimeFormatter(TimeDisplayFormat timeFormatter)
Display format to use for the time portion of events' date information. |
void |
setTimeFormatter(TimeFormatter timeFormatter)
Deprecated. use setTimeFormatter(TimeDisplayFormat) instead. |
void |
setTimelineGranularity(TimeUnit timelineGranularity)
The granularity with which the timelineView will display events. |
void |
setTimelineRange(Date start,
Date end)
Sets the range over which the timeline will display events |
void |
setTimelineUnitsPerColumn(int timelineUnitsPerColumn)
How many units of timelineGranularity each
cell represents. |
void |
setTimelineViewTitle(String timelineViewTitle)
The title for the timeline view |
void |
setTitleField(String titleField)
Sets the best field to use for a user-visible title for an individual record from this component. |
void |
setTodayBackgroundColor(String todayBackgroundColor)
The background color for today when +{timelineGranularity} is "day" |
void |
setTrailingDateField(String trailingDateField)
The name of the trailing date field for each event. |
void |
setUpdateOperation(String updateOperation)
Operation ID this component should use when performing update operations. |
void |
setUseAllDataSourceFields(Boolean useAllDataSourceFields)
If true, the set of fields given by the "default binding" (see fields ) is used, with any fields specified in
component.fields acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
|
void |
setUseFlatFields(Boolean useFlatFields)
The useFlatFields flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding. |
void |
setWeekEventBorderOverlap(Boolean weekEventBorderOverlap)
Augments the width of week event windows slightly to avoid duplicate adjacent borders between events. |
void |
setWeekViewTitle(String weekViewTitle)
The title for the week view |
void |
setWorkdayBaseStyle(String workdayBaseStyle)
If showWorkday is set, style used for cells that
are within the workday, as defined by workdayStart
and workdayEnd . |
void |
setWorkdayEnd(String workdayEnd)
When using showWorkday :true,
workdayStart and workdayEnd specify the time of day when the workday starts and ends,
specified as a String acceptable to String. |
void |
setWorkdays(int[] workdays)
Array of days that are considered workdays when showWorkday is true |
void |
setWorkdayStart(String workdayStart)
When using showWorkday :true,
workdayStart and workdayEnd specify the time of day when the workday starts and ends,
specified as a String acceptable to String. |
void |
transferSelectedData(DataBoundComponent source)
Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction. |
void |
transferSelectedData(DataBoundComponent source,
int index)
Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction. |
void |
updateEvent(CalendarEvent event,
Date startDate,
Date endDate,
String name,
String description)
update an event in this calendar. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.smartgwt.client.widgets.DataBoundComponent |
---|
getOrCreateJsObj |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public Calendar()
public Calendar(JavaScriptObject jsObj)
Method Detail |
---|
public static Calendar getOrCreateRef(JavaScriptObject jsObj)
public void setJavaScriptObject(JavaScriptObject jsObj)
setJavaScriptObject
in class Canvas
protected JavaScriptObject create()
create
in class Canvas
public void setAddEventButtonHoverText(String addEventButtonHoverText) throws IllegalStateException
add event
toolbar button
addEventButtonHoverText
- . See String
. Default value is "Add an event"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getAddEventButtonHoverText()
add event
toolbar button
String
public void setBaseStyle(String baseStyle)
baseStyle
- . See CSSStyleName
. Default value is "calendar"Appearance overview and related methods
public String getBaseStyle()
CSSStyleName
Appearance overview and related methods
public void setCancelButtonTitle(String cancelButtonTitle) throws IllegalStateException
cancelButtonTitle
- . See String
. Default value is "Cancel"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getCancelButtonTitle()
String
public void setCanCreateEvents(Boolean canCreateEvents) throws IllegalStateException
canCreateEvents
- canCreateEvents Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getCanCreateEvents()
public void setCanDeleteEvents(Boolean canDeleteEvents) throws IllegalStateException
canEditEvents
canDeleteEvents
- canDeleteEvents Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getCanDeleteEvents()
canEditEvents
public void setCanDragEventField(String canDragEventField) throws IllegalStateException
CalendarEvent
that determines dragability.
canDragEventField
- . See String
. Default value is "canEdit"
IllegalStateException
- this property cannot be changed after the component has been createdCalendarEvent
public String getCanDragEventField()
CalendarEvent
that determines dragability.
String
CalendarEvent
public void setCanDragEvents(Boolean canDragEvents) throws IllegalStateException
canDragEvents
- canDragEvents Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getCanDragEvents()
public void setCanEditEvents(Boolean canEditEvents) throws IllegalStateException
canEditEvents
- canEditEvents Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getCanEditEvents()
public void setCanEditField(String canEditField) throws IllegalStateException
CalendarEvent
that determines editability.
canEditField
- . See String
. Default value is "canEdit"
IllegalStateException
- this property cannot be changed after the component has been createdCalendarEvent
public String getCanEditField()
CalendarEvent
that determines editability.
String
CalendarEvent
public void setCanEditLane(Boolean canEditLane) throws IllegalStateException
laneNameField
? If so, the event can be dragged to a
different lane
and, when it's editor is shown, an
additional drop-down widget is provided allowing the user to select a different lane. In either case, the event's
laneNameField
is updated automatically.
canEditLane
- canEditLane Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getCanEditLane()
laneNameField
? If so, the event can be dragged to a
different lane
and, when it's editor is shown, an
additional drop-down widget is provided allowing the user to select a different lane. In either case, the event's
laneNameField
is updated automatically.
public void setCanResizeTimelineEvents(Boolean canResizeTimelineEvents) throws IllegalStateException
canResizeTimelineEvents
- canResizeTimelineEvents Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getCanResizeTimelineEvents()
public void setChosenDate(Date chosenDate)
chosenDate
- the new date to set as the current date. Default value is 'Today'public Date getChosenDate()
public void setCurrentViewName(ViewName currentViewName)
currentViewName
- The name of the view that should be made visible.. Default value is nullpublic ViewName getCurrentViewName()
public void setDataFetchMode(FetchMode dataFetchMode)
FetchMode
. This
setting only applies to the ResultSet
automatically created by calling Calendar.fetchData
. If a pre-existing ResultSet is passed to
setData() instead, it's existing setting for fetchMode
applies.
setDataFetchMode
in interface DataBoundComponent
dataFetchMode
- dataFetchMode Default value is "paged"Databinding overview and related methods
public FetchMode getDataFetchMode()
FetchMode
. This
setting only applies to the ResultSet
automatically created by calling Calendar.fetchData
. If a pre-existing ResultSet is passed to
setData() instead, it's existing setting for fetchMode
applies.
getDataFetchMode
in interface DataBoundComponent
Databinding overview and related methods
public void setDateEditingStyle(DateEditingStyle dateEditingStyle) throws IllegalStateException
DateEditingStyle
type. If unset, the editing style will be set to the
field-type on the DataSource, if there is one. If there's no DataSource, it will be set to "date" if the granularity
is "day" or larger and "time" if
granularity is "minute" or smaller, otherwise "datetime".
dateEditingStyle
- dateEditingStyle Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DateEditingStyle getDateEditingStyle()
DateEditingStyle
type. If unset, the editing style will be set to the
field-type on the DataSource, if there is one. If there's no DataSource, it will be set to "date" if the granularity
is "day" or larger and "time" if
granularity is "minute" or smaller, otherwise "datetime".
public void setDateFormatter(DateDisplayFormat dateFormatter)
DateDisplayFormat
.
dateFormatter
- dateFormatter Default value is nullpublic DateDisplayFormat getDateFormatter()
DateDisplayFormat
.
public void setDatePickerHoverText(String datePickerHoverText) throws IllegalStateException
date picker
toolbar button
datePickerHoverText
- . See String
. Default value is "Choose a date"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getDatePickerHoverText()
date picker
toolbar button
String
public void setDayBodyBaseStyle(String dayBodyBaseStyle)
dayBodyBaseStyle
- . See CSSStyleName
. Default value is "calMonthDayBody"Appearance overview and related methods
public String getDayBodyBaseStyle()
CSSStyleName
Appearance overview and related methods
public void setDayHeaderBaseStyle(String dayHeaderBaseStyle)
dayHeaderBaseStyle
- . See CSSStyleName
. Default value is "calMonthDayHeader"Appearance overview and related methods
public String getDayHeaderBaseStyle()
CSSStyleName
Appearance overview and related methods
public void setDayViewTitle(String dayViewTitle) throws IllegalStateException
dayViewTitle
- . See String
. Default value is "Day"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getDayViewTitle()
String
public void setDescriptionField(String descriptionField) throws IllegalStateException
CalendarEvent
.
descriptionField
- . See String
. Default value is "description"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getDescriptionField()
CalendarEvent
.
String
public void setDetailsButtonTitle(String detailsButtonTitle) throws IllegalStateException
detailsButtonTitle
- . See String
. Default value is "Edit Details"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getDetailsButtonTitle()
String
public void setDisableWeekends(Boolean disableWeekends) throws IllegalStateException
disableWeekends
- disableWeekends Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdVisibility overview and related methods
public Boolean getDisableWeekends()
Visibility overview and related methods
public void setEndDate(Date endDate) throws IllegalStateException
Note that this attribute may be
automatically altered if header-levels
to fit to
header boundaries.
endDate
- endDate Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Date getEndDate()
Note that this attribute may be
automatically altered if header-levels
to fit to
header boundaries.
public void setEndDateField(String endDateField) throws IllegalStateException
CalendarEvent
.
endDateField
- . See String
. Default value is "endDate"
IllegalStateException
- this property cannot be changed after the component has been createdCalendarEvent
public String getEndDateField()
CalendarEvent
.
String
CalendarEvent
public void setEventAutoArrange(Boolean eventAutoArrange) throws IllegalStateException
eventAutoArrange
- eventAutoArrange Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getEventAutoArrange()
public void setEventDragGap(int eventDragGap)
eventDragGap
- eventDragGap Default value is 10public int getEventDragGap()
public void setEventNameFieldTitle(String eventNameFieldTitle) throws IllegalStateException
eventNameFieldTitle
- . See String
. Default value is "Event Name"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getEventNameFieldTitle()
String
public void setEventOverlap(Boolean eventOverlap) throws IllegalStateException
eventAutoArrange
is true, setting
eventOverlap to true causes events that share timeslots to overlap each other by a percentage of their width, specified
by eventOverlapPercent
. The default is
true.
eventOverlap
- eventOverlap Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getEventOverlap()
eventAutoArrange
is true, setting
eventOverlap to true causes events that share timeslots to overlap each other by a percentage of their width, specified
by eventOverlapPercent
. The default is
true.
public void setEventOverlapIdenticalStartTimes(Boolean eventOverlapIdenticalStartTimes) throws IllegalStateException
eventOverlapIdenticalStartTimes
- eventOverlapIdenticalStartTimes Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getEventOverlapIdenticalStartTimes()
public void setEventOverlapPercent(int eventOverlapPercent) throws IllegalStateException
eventOverlapPercent
- eventOverlapPercent Default value is 10
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getEventOverlapPercent()
public void setEventSnapGap(int eventSnapGap) throws IllegalStateException
eventSnapGap
- eventSnapGap Default value is 30
IllegalStateException
- this property cannot be changed after the component has been createdEditing overview and related methods
public int getEventSnapGap()
Editing overview and related methods
public void setEventWindowStyle(String eventWindowStyle)
eventWindowStyle
- . See CSSStyleName
. Default value is "eventWindow"Appearance overview and related methods
public String getEventWindowStyle()
CSSStyleName
Appearance overview and related methods
public void setEventWindowStyleField(String eventWindowStyleField) throws IllegalStateException
eventWindowStyle
for an individual CalendarEvent
. See eventWindowStyle
.
eventWindowStyleField
- . See String
. Default value is "eventWindowStyle"
IllegalStateException
- this property cannot be changed after the component has been createdAppearance overview and related methods
public String getEventWindowStyleField()
eventWindowStyle
for an individual CalendarEvent
. See eventWindowStyle
.
String
Appearance overview and related methods
public void setFirstDayOfWeek(int firstDayOfWeek)
firstDayOfWeek
- firstDayOfWeek Default value is 0public int getFirstDayOfWeek()
public void setHeaderLevels(HeaderLevel... headerLevels) throws IllegalStateException
headers
shown above the event area,
and their time units. Header levels are provided from the top down, so the first header level should be the largest time unit and the last one the smallest. The smallest is then used for the actual field-headers.
headerLevels
- headerLevels Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic HeaderLevel[] getHeaderLevels()
headers
shown above the event area,
and their time units. Header levels are provided from the top down, so the first header level should be the largest time unit and the last one the smallest. The smallest is then used for the actual field-headers.
public void setInvalidDateMessage(Boolean invalidDateMessage) throws IllegalStateException
eventEditor
when the
'To' date is greater than the 'From' date and a save is attempted.
invalidDateMessage
- invalidDateMessage Default value is "From must be before To"
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getInvalidDateMessage()
eventEditor
when the
'To' date is greater than the 'From' date and a save is attempted.
public void setLaneNameField(String laneNameField) throws IllegalStateException
lane
in
which this event will be displayed for the timelineView
laneNameField
- . See String
. Default value is "lane"
IllegalStateException
- this property cannot be changed after the component has been createdCalendarEvent
public String getLaneNameField()
lane
in
which this event will be displayed for the timelineView
String
CalendarEvent
public void setLeadingDateField(String leadingDateField) throws IllegalStateException
trailingDateField
are present in the data, a line
extends out from the event showing the extent of the leading and trailing dates - useful for visualizing a pipeline of
events where some can be moved a certain amount without affecting others.
leadingDateField
- . See String
. Default value is "leadingDate"
IllegalStateException
- this property cannot be changed after the component has been createdCalendarEvent
public String getLeadingDateField()
trailingDateField
are present in the data, a line
extends out from the event showing the extent of the leading and trailing dates - useful for visualizing a pipeline of
events where some can be moved a certain amount without affecting others.
String
CalendarEvent
public void setMonthViewTitle(String monthViewTitle) throws IllegalStateException
monthViewTitle
- . See String
. Default value is "Month"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getMonthViewTitle()
String
public void setNameField(String nameField) throws IllegalStateException
CalendarEvent
.
nameField
- . See String
. Default value is "name"
IllegalStateException
- this property cannot be changed after the component has been createdCalendarEvent
public String getNameField()
CalendarEvent
.
String
CalendarEvent
public void setNextButtonHoverText(String nextButtonHoverText) throws IllegalStateException
next
toolbar button
nextButtonHoverText
- . See String
. Default value is "Next"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getNextButtonHoverText()
next
toolbar button
String
public void setOtherDayBlankStyle(String otherDayBlankStyle) throws IllegalStateException
showOtherDays
is false.
otherDayBlankStyle
- . See CSSStyleName
. Default value is "calMonthOtherDayBlank"
IllegalStateException
- this property cannot be changed after the component has been createdAppearance overview and related methods
public String getOtherDayBlankStyle()
showOtherDays
is false.
CSSStyleName
Appearance overview and related methods
public void setOtherDayBodyBaseStyle(String otherDayBodyBaseStyle)
otherDayBodyBaseStyle
- . See CSSStyleName
. Default value is "calMonthDayBody"Appearance overview and related methods
public String getOtherDayBodyBaseStyle()
CSSStyleName
Appearance overview and related methods
public void setOtherDayHeaderBaseStyle(String otherDayHeaderBaseStyle)
otherDayHeaderBaseStyle
- . See CSSStyleName
. Default value is "calMonthDayHeader"Appearance overview and related methods
public String getOtherDayHeaderBaseStyle()
CSSStyleName
Appearance overview and related methods
public void setPreviousButtonHoverText(String previousButtonHoverText) throws IllegalStateException
previous
toolbar button
previousButtonHoverText
- . See String
. Default value is "Previous"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getPreviousButtonHoverText()
previous
toolbar button
String
public void setRowHeight(int rowHeight)
rowHeight
- rowHeight Default value is 20public int getRowHeight()
public void setSaveButtonTitle(String saveButtonTitle) throws IllegalStateException
saveButtonTitle
- . See String
. Default value is "Save Event"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getSaveButtonTitle()
String
public void setScrollToWorkday(Boolean scrollToWorkday) throws IllegalStateException
workday hours
to be sized to
fill the available space in the day view and week view, and automatically scrolls these views to the start of the
workday when the calendar is first displayed and whenever the user switches to a new day or week.
scrollToWorkday
- scrollToWorkday Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getScrollToWorkday()
workday hours
to be sized to
fill the available space in the day view and week view, and automatically scrolls these views to the start of the
workday when the calendar is first displayed and whenever the user switches to a new day or week.
public void setSelectedCellStyle(String selectedCellStyle)
selectedCellStyle
- . See CSSStyleName
. Default value is "calendarCellSelected"Appearance overview and related methods
public String getSelectedCellStyle()
CSSStyleName
Appearance overview and related methods
public void setShowControlsBar(Boolean showControlsBar) throws IllegalStateException
previousButton
, nextButton
, addEventButton
, datePickerButton
showControlsBar
- showControlsBar Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowControlsBar()
previousButton
, nextButton
, addEventButton
, datePickerButton
public void setShowDateChooser(Boolean showDateChooser) throws IllegalStateException
dateChooser
is displayed.
showDateChooser
- showDateChooser Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdVisibility overview and related methods
public Boolean getShowDateChooser()
dateChooser
is displayed.
Visibility overview and related methods
public void setShowDayHeaders(Boolean showDayHeaders) throws IllegalStateException
showDayHeaders
- showDayHeaders Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdVisibility overview and related methods
public Boolean getShowDayHeaders()
Visibility overview and related methods
public void setShowDetailFields(Boolean showDetailFields) throws IllegalStateException
detail:true
when a DataBoundComponent is given a DataSource but no
component.fields
. The detail
property is used on DataSource fields to mark fields that
shouldn't appear by default in a view that tries to show many records in a small space.
setShowDetailFields
in interface DataBoundComponent
showDetailFields
- showDetailFields Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdDatabinding overview and related methods
public Boolean getShowDetailFields()
detail:true
when a DataBoundComponent is given a DataSource but no
component.fields
. The detail
property is used on DataSource fields to mark fields that
shouldn't appear by default in a view that tries to show many records in a small space.
getShowDetailFields
in interface DataBoundComponent
Databinding overview and related methods
public void setShowEventDescriptions(Boolean showEventDescriptions) throws IllegalStateException
showEventDescriptions
- showEventDescriptions Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowEventDescriptions()
public void setShowOtherDays(Boolean showOtherDays) throws IllegalStateException
otherDayBlankStyle
and are non-interactive.
showOtherDays
- showOtherDays Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdVisibility overview and related methods
public Boolean getShowOtherDays()
otherDayBlankStyle
and are non-interactive.
Visibility overview and related methods
public void setShowQuickEventDialog(Boolean showQuickEventDialog) throws IllegalStateException
showQuickEventDialog
- showQuickEventDialog Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdEditing overview and related methods
public Boolean getShowQuickEventDialog()
Editing overview and related methods
public void setShowTimelineView(Boolean showTimelineView)
showTimelineView
- showTimelineView Default value is falsepublic Boolean getShowTimelineView()
public void setShowWeekends(Boolean showWeekends) throws IllegalStateException
showWeekends
to change this property at runtime.
showWeekends
- showWeekends Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdVisibility overview and related methods
public Boolean getShowWeekends()
Visibility overview and related methods
public void setShowWorkday(Boolean showWorkday) throws IllegalStateException
workdayBaseStyle
for cells falling within the workday as defined by workdayStart
and workdayEnd
, in both the weekView
and dayView
.
showWorkday
- showWorkday Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowWorkday()
workdayBaseStyle
for cells falling within the workday as defined by workdayStart
and workdayEnd
, in both the weekView
and dayView
.
public void setSizeEventsToGrid(Boolean sizeEventsToGrid) throws IllegalStateException
sizeEventsToGrid
- sizeEventsToGrid Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getSizeEventsToGrid()
public void setStartDate(Date startDate) throws IllegalStateException
timeline view
. Has no effect in
other views. If not specified, defaults to a 20-column timeline starting from the beginning of the current timelineGranularity
. Note that this attribute
may be automatically altered if header-levels
to
fit to header boundaries.
startDate
- startDate Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Date getStartDate()
timeline view
. Has no effect in
other views. If not specified, defaults to a 20-column timeline starting from the beginning of the current timelineGranularity
. Note that this attribute
may be automatically altered if header-levels
to
fit to header boundaries.
public void setStartDateField(String startDateField) throws IllegalStateException
CalendarEvent
.
startDateField
- . See String
. Default value is "startDate"
IllegalStateException
- this property cannot be changed after the component has been createdCalendarEvent
public String getStartDateField()
CalendarEvent
.
String
CalendarEvent
public void setTimelineGranularity(TimeUnit timelineGranularity) throws IllegalStateException
TimeUnit
type.
timelineGranularity
- timelineGranularity Default value is "day"
IllegalStateException
- this property cannot be changed after the component has been createdpublic TimeUnit getTimelineGranularity()
TimeUnit
type.
public void setTimelineUnitsPerColumn(int timelineUnitsPerColumn) throws IllegalStateException
timelineGranularity
each
cell represents.
timelineUnitsPerColumn
- timelineUnitsPerColumn Default value is 1
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getTimelineUnitsPerColumn()
timelineGranularity
each
cell represents.
public void setTimelineViewTitle(String timelineViewTitle) throws IllegalStateException
timelineViewTitle
- . See String
. Default value is "Timeline"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getTimelineViewTitle()
String
public void setTodayBackgroundColor(String todayBackgroundColor) throws IllegalStateException
todayBackgroundColor
- . See String
. Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getTodayBackgroundColor()
String
public void setTrailingDateField(String trailingDateField) throws IllegalStateException
leadingDateField
are present in the data, a line
extends out from the event showing the extent of the leading and trailing dates - useful for visualizing a pipeline of
events where some can be moved a certain amount without affecting others.
trailingDateField
- . See String
. Default value is "trailingDate"
IllegalStateException
- this property cannot be changed after the component has been createdCalendarEvent
public String getTrailingDateField()
leadingDateField
are present in the data, a line
extends out from the event showing the extent of the leading and trailing dates - useful for visualizing a pipeline of
events where some can be moved a certain amount without affecting others.
String
CalendarEvent
public void setWeekEventBorderOverlap(Boolean weekEventBorderOverlap) throws IllegalStateException
weekEventBorderOverlap
- weekEventBorderOverlap Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdAppearance overview and related methods
public Boolean getWeekEventBorderOverlap()
Appearance overview and related methods
public void setWeekViewTitle(String weekViewTitle) throws IllegalStateException
weekViewTitle
- . See String
. Default value is "Week"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getWeekViewTitle()
String
public void setWorkdayBaseStyle(String workdayBaseStyle) throws IllegalStateException
showWorkday
is set, style used for cells that
are within the workday, as defined by workdayStart
and workdayEnd
.
workdayBaseStyle
- . See CSSStyleName
. Default value is "calendarWorkday"
IllegalStateException
- this property cannot be changed after the component has been createdAppearance overview and related methods
public String getWorkdayBaseStyle()
showWorkday
is set, style used for cells that
are within the workday, as defined by workdayStart
and workdayEnd
.
CSSStyleName
Appearance overview and related methods
public void setWorkdayEnd(String workdayEnd) throws IllegalStateException
showWorkday
:true,
workdayStart
and workdayEnd
specify the time of day when the workday starts and ends,
specified as a String acceptable to String. Both start and end time must fall on a 30 minute increment (eg 9:30, but not 9:45).
workdayEnd
- . See String
. Default value is "5:00pm"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getWorkdayEnd()
showWorkday
:true,
workdayStart
and workdayEnd
specify the time of day when the workday starts and ends,
specified as a String acceptable to String. Both start and end time must fall on a 30 minute increment (eg 9:30, but not 9:45).
String
public void setWorkdayStart(String workdayStart) throws IllegalStateException
showWorkday
:true,
workdayStart
and workdayEnd
specify the time of day when the workday starts and ends,
specified as a String acceptable to String. Both start and end time must fall on a 30 minute increment (eg 9:30, but not 9:45).
workdayStart
- . See String
. Default value is "9:00am"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getWorkdayStart()
showWorkday
:true,
workdayStart
and workdayEnd
specify the time of day when the workday starts and ends,
specified as a String acceptable to String. Both start and end time must fall on a 30 minute increment (eg 9:30, but not 9:45).
String
public void addLane(Lane lane)
Lane
to the calendar in timelineView
mode.
lane
- a new Lane object to add to the timeline viewpublic HandlerRegistration addBackgroundClickHandler(BackgroundClickHandler handler)
Callback fired when the mouse is clicked in a background-cell, ie, one without an event.
addBackgroundClickHandler
in interface HasBackgroundClickHandlers
handler
- the backgroundClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addBackgroundMouseDownHandler(BackgroundMouseDownHandler handler)
Callback fired when the mouse button is depressed over a background-cell, ie, one without an event. Call BackgroundMouseDownEvent.cancel()
from within BackgroundMouseDownHandler.onBackgroundMouseDown(com.smartgwt.client.widgets.calendar.events.BackgroundMouseDownEvent)
to
cancel the default behavior of allowing sweep selection via dragging.
addBackgroundMouseDownHandler
in interface HasBackgroundMouseDownHandlers
handler
- the backgroundMouseDown handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addDateChangedHandler(DateChangedHandler handler)
Fires whenever the user changes the current date, including picking a specific date or navigating to a new week or month.
addDateChangedHandler
in interface HasDateChangedHandlers
handler
- the dateChanged handler
HandlerRegistration
used to remove this handlerpublic Boolean dateIsWorkday(Date date)
workdays
, and returns true if found. Override this method to
provide custom logic for determining workday, for example returning false on holidays.
date
- date to check for being a workday
public HandlerRegistration addDayBodyClickHandler(DayBodyClickHandler handler)
Called when the body area of a day in the month view is clicked on, outside of any links to a particular event.
By
default, if the user can add events, shows a dialog for adding a new event for that day. Call DayBodyClickEvent.cancel()
from within DayBodyClickHandler.onDayBodyClick(com.smartgwt.client.widgets.calendar.events.DayBodyClickEvent)
to cancel this
action.
Not called if the day falls outside the current month and showOtherDays
is false.
addDayBodyClickHandler
in interface HasDayBodyClickHandlers
handler
- the dayBodyClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addDayHeaderClickHandler(DayHeaderClickHandler handler)
Called when the header area of a day in the month view is clicked on.
By default, moves to the day tab and shows the
clicked days events. Call DayHeaderClickEvent.cancel()
from within DayHeaderClickHandler.onDayHeaderClick(com.smartgwt.client.widgets.calendar.events.DayHeaderClickEvent)
to cancel this action.
Not called if the day falls outside the current month and
showOtherDays
is false.
addDayHeaderClickHandler
in interface HasDayHeaderClickHandlers
handler
- the dayHeaderClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addEventAddedHandler(EventAddedHandler handler)
Notification fired whenever a user adds an event.
In a calendar with a DataSource, eventAdded() fires after the event has been successfully added to the server
addEventAddedHandler
in interface HasEventAddedHandlers
handler
- the eventAdded handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addEventChangedHandler(EventChangedHandler handler)
Notification fired whenever a user changes an event, whether by dragging the event or by editing it in a dialog.
In a calendar with a DataSource, eventChanged() fires after the updated event has been successfully saved to the server
addEventChangedHandler
in interface HasEventChangedHandlers
handler
- the eventChanged handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addEventClickHandler(EventClickHandler handler)
Called whenever an event is clicked on in the day, week or month views.
By default a dialog appears showing details
for the event, and offering the ability to edit events which are editable. Call CalendarEventClick.cancel()
from within EventClickHandler.onEventClick(com.smartgwt.client.widgets.calendar.events.CalendarEventClick)
to cancel the default action.
This is a good place to, for example, show a completely customized event dialog instead of the default one.
addEventClickHandler
in interface HasEventClickHandlers
handler
- the eventClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addEventMovedHandler(EventMovedHandler handler)
Called when an event is moved via dragging by a user. Call CalendarEventMoved.cancel()
from within EventMovedHandler.onEventMoved(com.smartgwt.client.widgets.calendar.events.CalendarEventMoved)
to disallow the move.
addEventMovedHandler
in interface HasEventMovedHandlers
handler
- the eventMoved handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addEventRemoveClickHandler(EventRemoveClickHandler handler)
Called whenever the close icon of an event is clicked within the day or week view. Call CalendarEventRemoveClick.cancel()
from within EventRemoveClickHandler.onEventRemoveClick(com.smartgwt.client.widgets.calendar.events.CalendarEventRemoveClick)
to cancel the removal,
or .
Implement this method to do something like, for example, showing a confirmation dialog before an event is removed.
addEventRemoveClickHandler
in interface HasEventRemoveClickHandlers
handler
- the eventRemoveClick handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addEventRemovedHandler(EventRemovedHandler handler)
Notification fired whenever a user removes an event
In a calendar with a DataSource, eventRemoved() fires after the event has been successfully removed from the server
addEventRemovedHandler
in interface HasEventRemovedHandlers
handler
- the eventRemoved handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addEventResizedHandler(EventResizedHandler handler)
Called when an event is resized via dragging by a user. Call CalendarEventResized.cancel()
from within EventResizedHandler.onEventResized(com.smartgwt.client.widgets.calendar.events.CalendarEventResized)
to disallow the resize.
addEventResizedHandler
in interface HasEventResizedHandlers
handler
- the eventResized handler
HandlerRegistration
used to remove this handlerpublic void eventsRendered()
public int getActiveDay()
getActiveTime()
public Date getActiveTime()
public Date getPeriodEndDate()
Calendar.getVisibleEndDate
.
public Date getPeriodStartDate()
Calendar.getVisibleEndDate
.
public Date getVisibleEndDate()
public Date getVisibleStartDate()
public void next()
public void previous()
public void selectTab(int tabnum)
tabnum
- the index of the tab to selectpublic void setTimelineRange(Date start, Date end)
start
- start of rangeend
- end of rangepublic static void setDefaultProperties(Calendar calendarProperties)
Note: This method is intended for setting default attributes only and will effect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead.
calendarProperties
- properties that should be used as new defaults when instances of this class are createdprotected void onInit()
onInit
in class Canvas
protected void onInit_Calendar()
protected String getDayBodyHTML(Date date, CalendarEvent[] events, Calendar calendar, int rowNum, int colNum)
public void setEventEditorFields(FormItem... eventEditorFields) throws IllegalStateException
eventEditor
. The default set of fields are:
{name: "startHours", title: "From", type: "select", width: 60}, {name: "startMinutes", showTitle: false, type: "select", width: 60}, {name: "startAMPM", showTitle: false, type: "select", width: 60}, {name: "invalidDate", type: "blurb", colSpan: 4, visible: false} {name: "endHours", title: "To", type: "select", width: 60}, {name: "endMinutes", showTitle: false, type: "select", width: 60}, {name: "endAMPM", showTitle: false, type: "select", width: 60}, {name: "name", title: "Name", type: "text", colSpan: 4}, {name: "description", title: "Description", type: "textArea", colSpan: 4, height: 50}See the Customized Binding example below for more information on altering default datasource fields within forms.
eventEditorFields
- eventEditorFields Default value is see below
IllegalStateException
- this property cannot be changed after the component has been createdpublic void setEventDialogFields(FormItem... eventDialogFields) throws IllegalStateException
eventDialog
. The default set of fields are:
{name: "name", title: "Event Name", type: nameType, width: 250 }, {name: "save", title: "Save Event", type: "SubmitItem", endRow: false}, {name: "details", title: "Edit Details", type: "button", startRow: false}See the Customized Binding example below for more information on altering default datasource fields within forms.
eventDialogFields
- eventDialogFields Default value is see below
IllegalStateException
- this property cannot be changed after the component has been createdpublic void setData(CalendarEvent[] data)
This property
will typically not be explicitly specified for databound Calendars, where the data is returned from the server
via databound component methods such as fetchData()
. In this
case the data objects will be set to a ResultSet
rather than a simple array.
Initialize the data object with the given array. Observes methods of the data object so that when the data
changes, the calendar will redraw automatically.
data
- data to show in the list. Default value is nullpublic void setData(Record[] data)
data
- array of Record objects.setData(CalendarEvent[])
public void setData(RecordList data)
data
- List of Recordspublic void setTimeFormatter(TimeFormatter timeFormatter)
setTimeFormatter(TimeDisplayFormat)
instead.
timeFormatter
- timeFormatter Default value is "toShortPaddedTime"public void setTimeFormatter(TimeDisplayFormat timeFormatter)
timeFormatter
- timeFormatter Default value is "toShortPaddedTime"public TimeDisplayFormat getTimeFormatter()
public Lane[] getLanes()
public void setLanes(Lane... lanes)
lanes
- array of Lane objectspublic ListGridField[] getLaneFields()
public void setLaneFields(ListGridField... laneFields)
laneFields
- array of ListGridField objectspublic void removeLane(Lane lane)
timelineView
mode.
lane
- the lane to removepublic void removeLane(String laneName)
timelineView
mode.
laneName
- the name of the lane to removepublic void addEvent(Date startDate, Date endDate, String name, String description)
startDate
- start date of eventendDate
- end date of eventname
- name of eventdescription
- description of eventpublic void addEvent(Date startDate, Date endDate, String name, String description, Map otherFields)
startDate
- start date of eventendDate
- end date of eventname
- name of eventdescription
- description of eventotherFields
- new values of additional fields to be updatedpublic void removeEvent(CalendarEvent event)
event
- The event object to remove from the calendarpublic void updateEvent(CalendarEvent event, Date startDate, Date endDate, String name, String description)
event
- The event object to remove from the calendarstartDate
- start date of eventendDate
- end date of eventname
- name of eventdescription
- description of eventpublic void setShowDayView(Boolean showDayView) throws IllegalStateException
IllegalStateException
public void setShowWeekView(Boolean showWeekView) throws IllegalStateException
IllegalStateException
public void setShowMonthView(Boolean showMonthView) throws IllegalStateException
IllegalStateException
public void setShowDatePickerButton(Boolean showDatePickerButton) throws IllegalStateException
IllegalStateException
public void setShowAddEventButton(Boolean showAddEventButton) throws IllegalStateException
IllegalStateException
public void setWorkdays(int[] workdays) throws IllegalStateException
showWorkday
is true
workdays
- workdays Default value is [1,2,3,4,5]
IllegalStateException
- this property cannot be changed after the component has been createdpublic CalendarEvent[] getData()
public static boolean calendarLoaded()
public void setDataPageSize(int dataPageSize)
DataBoundComponent
ResultSet
object for this
component. In effect, this gives you control over the resultSize
attribute for this component.
Note that regardless of the dataPageSize
setting, a component will always fetch
all of data that it needs to draw. Settings such as
showAllRecords
,
drawAllMaxCells
and
drawAheadRatio
can cause more rows than the configured
dataPageSize
to be fetched.
setDataPageSize
in interface DataBoundComponent
dataPageSize
- dataPageSize Default value is 75public int getDataPageSize()
DataBoundComponent
ResultSet
object for this
component. In effect, this gives you control over the resultSize
attribute for this component.
Note that regardless of the dataPageSize
setting, a component will always fetch
all of data that it needs to draw. Settings such as
showAllRecords
,
drawAllMaxCells
and
drawAheadRatio
can cause more rows than the configured
dataPageSize
to be fetched.
getDataPageSize
in interface DataBoundComponent
public void setUseAllDataSourceFields(Boolean useAllDataSourceFields)
DataBoundComponent
fields
) is used, with any fields specified in
component.fields
acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
If component.fields
contains fields that are not found in the DataSource,
they will be shown after the most recently referred to DataSource field. If the new
fields appear first, they will be shown first.
setUseAllDataSourceFields
in interface DataBoundComponent
useAllDataSourceFields
- useAllDataSourceFields Default value is falsepublic Boolean getUseAllDataSourceFields()
DataBoundComponent
fields
) is used, with any fields specified in
component.fields
acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
If component.fields
contains fields that are not found in the DataSource,
they will be shown after the most recently referred to DataSource field. If the new
fields appear first, they will be shown first.
getUseAllDataSourceFields
in interface DataBoundComponent
public void setShowHiddenFields(Boolean showHiddenFields)
DataBoundComponent
hidden:true
when a DataBoundComponent is given a
DataSource but no component.fields
.
The hidden
property is used on DataSource fields to mark fields that are
never of meaning to an end user.
setShowHiddenFields
in interface DataBoundComponent
showHiddenFields
- showHiddenFields Default value is falsepublic Boolean getShowHiddenFields()
DataBoundComponent
hidden:true
when a DataBoundComponent is given a
DataSource but no component.fields
.
The hidden
property is used on DataSource fields to mark fields that are
never of meaning to an end user.
getShowHiddenFields
in interface DataBoundComponent
public void setShowComplexFields(Boolean showComplexFields)
DataBoundComponent
component.fields
.
If true, the component will show fields that declare a complex type, for example, a field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a DataSource that declares the fields of a shipping address (city, street name, etc).
Such fields may need custom formatters or editors in order to create a usable interface, for example, an Address field in a ListGrid might use a custom formatter to combine the relevant fields of an address into one column, and might use a pop-up dialog for editing.
Note : This is an advanced setting
setShowComplexFields
in interface DataBoundComponent
showComplexFields
- showComplexFields Default value is truepublic Boolean getShowComplexFields()
DataBoundComponent
component.fields
.
If true, the component will show fields that declare a complex type, for example, a field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a DataSource that declares the fields of a shipping address (city, street name, etc).
Such fields may need custom formatters or editors in order to create a usable interface, for example, an Address field in a ListGrid might use a custom formatter to combine the relevant fields of an address into one column, and might use a pop-up dialog for editing.
getShowComplexFields
in interface DataBoundComponent
public void setFetchOperation(String fetchOperation)
DataBoundComponent
setFetchOperation
in interface DataBoundComponent
fetchOperation
- fetchOperation Default value is nullpublic String getFetchOperation()
DataBoundComponent
getFetchOperation
in interface DataBoundComponent
public void setUpdateOperation(String updateOperation)
DataBoundComponent
setUpdateOperation
in interface DataBoundComponent
updateOperation
- updateOperation Default value is nullpublic String getUpdateOperation()
DataBoundComponent
getUpdateOperation
in interface DataBoundComponent
public void setAddOperation(String addOperation)
DataBoundComponent
setAddOperation
in interface DataBoundComponent
addOperation
- addOperation Default value is nullpublic String getAddOperation()
DataBoundComponent
getAddOperation
in interface DataBoundComponent
public void setRemoveOperation(String removeOperation)
DataBoundComponent
setRemoveOperation
in interface DataBoundComponent
removeOperation
- removeOperation Default value is nullpublic String getRemoveOperation()
DataBoundComponent
getRemoveOperation
in interface DataBoundComponent
public void setExportFields(String[] exportFields)
DataBoundComponent
If exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.
setExportFields
in interface DataBoundComponent
exportFields
- exportFields Default value is nullpublic String[] getExportFields()
DataBoundComponent
If exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.
getExportFields
in interface DataBoundComponent
public void setExportAll(Boolean exportAll)
DataBoundComponent
fields
.
If exportAll is false, an export operation will first consider
exportFields
, if it's set, and fall back on all visible fields from
fields
otherwise.
setExportAll
in interface DataBoundComponent
exportAll
- exportAll Default value is falsepublic Boolean getExportAll()
DataBoundComponent
fields
.
If exportAll is false, an export operation will first consider
exportFields
, if it's set, and fall back on all visible fields from
fields
otherwise.
getExportAll
in interface DataBoundComponent
public void setPreventDuplicates(Boolean preventDuplicates) throws IllegalStateException
DataBoundComponent
DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
.
When a duplicate transfer is detected,
a dialog will appear showing the duplicateDragMessage
.
If the component either does not have a DataSource
or has a DataSource with no
primaryKey
declared, duplicate checking is off by
default. If duplicate checking is enabled, it looks for an existing record in the dataset
that has all of the
properties of the dragged record, and considers that a duplicate.
For DragDataAction
:"copy" where the target DataSource is related to the source
DataSource by foreignKey, a duplicate means that
the target list, as filtered by the current
criteria, already has a record whose value for the foreignKey field matches the
primaryKey of the record being
transferred.
For example, consider dragging "employees" to "teams", where "teams" has a field "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target grid has search criteria causing it to show all the members of one team. A duplicate - adding an employee to the same team twice - is when the target grid's dataset contains an record with "employeeId" matching the "id" field of the dropped employee.
setPreventDuplicates
in interface DataBoundComponent
preventDuplicates
- preventDuplicates Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getPreventDuplicates()
DataBoundComponent
DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
.
When a duplicate transfer is detected,
a dialog will appear showing the duplicateDragMessage
.
If the component either does not have a DataSource
or has a DataSource with no
primaryKey
declared, duplicate checking is off by
default. If duplicate checking is enabled, it looks for an existing record in the dataset
that has all of the
properties of the dragged record, and considers that a duplicate.
For DragDataAction
:"copy" where the target DataSource is related to the source
DataSource by foreignKey, a duplicate means that
the target list, as filtered by the current
criteria, already has a record whose value for the foreignKey field matches the
primaryKey of the record being
transferred.
For example, consider dragging "employees" to "teams", where "teams" has a field "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target grid has search criteria causing it to show all the members of one team. A duplicate - adding an employee to the same team twice - is when the target grid's dataset contains an record with "employeeId" matching the "id" field of the dropped employee.
getPreventDuplicates
in interface DataBoundComponent
public void setDuplicateDragMessage(String duplicateDragMessage) throws IllegalStateException
DataBoundComponent
preventDuplicates
is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.
setDuplicateDragMessage
in interface DataBoundComponent
duplicateDragMessage
- duplicateDragMessage Default value is "Duplicates not allowed"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getDuplicateDragMessage()
DataBoundComponent
preventDuplicates
is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.
getDuplicateDragMessage
in interface DataBoundComponent
public void setAddDropValues(Boolean addDropValues)
DataBoundComponent
If this value is true and this component is databound, DataBoundComponent.getDropValues()
will be called for every databound item
dropped on this grid, and an update performed on the item
setAddDropValues
in interface DataBoundComponent
addDropValues
- addDropValues Default value is truepublic Boolean getAddDropValues()
DataBoundComponent
If this value is true and this component is databound, DataBoundComponent.getDropValues()
will be called for every databound item
dropped on this grid, and an update performed on the item
getAddDropValues
in interface DataBoundComponent
public void setDropValues(Map dropValues)
DataBoundComponent
addDropValues
is true and both the source and
target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key, this object provides the "drop values" that
Smart GWT will apply to the dropped object before updating it.If this property is not defined, Smart GWT defaults to returning the selection criteria currently in place for this component. Thus, any databound items (for example, rows from other grids bound to the same DataSource) dropped on the grid will, by default, be subjected to an update that makes them conform to the grid's current filter criteria.
Note : This is an advanced setting
setDropValues
in interface DataBoundComponent
dropValues
- dropValues Default value is nullpublic Map getDropValues()
DataBoundComponent
addDropValues
is true and both the source and
target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key, this object provides the "drop values" that
Smart GWT will apply to the dropped object before updating it.If this property is not defined, Smart GWT defaults to returning the selection criteria currently in place for this component. Thus, any databound items (for example, rows from other grids bound to the same DataSource) dropped on the grid will, by default, be subjected to an update that makes them conform to the grid's current filter criteria.
Note : This is an advanced setting
getDropValues
in interface DataBoundComponent
dropValues
for more details. If multiple records
are being dropped, this method is called for each of them in turn.
This method returns the following:
addDropValues
is falseYou can override this method if you need more complex setting of drop values than can be provided by simply supplying a dropValues object.
public void setUseFlatFields(Boolean useFlatFields) throws IllegalStateException
DataBoundComponent
useFlatFields
flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding.
useFlatFields
is typically used with imported metadata, such as
XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback)
from a
XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback)
, as a means of eliminating levels of XML
nesting that aren't meaningful in a user interface, without the cumbersome and fragile
process of mapping form fields to XML structures.
For example, having called WebService.getInputDS(java.lang.String)
to retrieve the input message
schema for a web service operation whose input message looks like this:
<FindServices> <searchFor>search text</searchFor> <Options> <caseSensitive>false</caseSensitive> </Options> <IncludeInSearch> <serviceName>true</serviceName> <documentation>true</documentation> <keywords>true</keywords> </IncludeInSearch> </FindServices>Setting
useFlatFields
on a DynamicForm
that is bound to this input
message schema would result in 5 FormItem
reflecting the 5 simple type
fields in the message.
For this form, the result of DynamicForm.getValues()
might look
like:
{ searchFor: "search text", caseSensitive: false, serviceName: true, documentation : true, keywords : true }When contacting a
WebService
, these values can be automatically
mapped to the structure of the input message for a web service operation by setting
useFlatFields
(for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)
) or by setting
useFlatFields
(for use with a DataSource
that is
'bound to a WSDL web service'
via
wsOperation
).
Using these two facilities in conjunction (component.useFlatFields and request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user presentation and when providing the data for XML messages.
You can also set useFlatFields
to automatically enable
"flattened" XML serialization (request.useFlatFields) for all DataSource requests of a
particular operationType.
Note that useFlatFields
is not generally recommended for use with structures
where multiple simple type fields exist with the same name, however if used with such a
structure, the first field to use a given name wins. "first" means the first field
encountered in a depth first search. "wins" means only the first field will be present as a
field when data binding.
setUseFlatFields
in interface DataBoundComponent
useFlatFields
- useFlatFields Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getUseFlatFields()
DataBoundComponent
useFlatFields
flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding.
useFlatFields
is typically used with imported metadata, such as
XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback)
from a
XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback)
, as a means of eliminating levels of XML
nesting that aren't meaningful in a user interface, without the cumbersome and fragile
process of mapping form fields to XML structures.
For example, having called WebService.getInputDS(java.lang.String)
to retrieve the input message
schema for a web service operation whose input message looks like this:
<FindServices> <searchFor>search text</searchFor> <Options> <caseSensitive>false</caseSensitive> </Options> <IncludeInSearch> <serviceName>true</serviceName> <documentation>true</documentation> <keywords>true</keywords> </IncludeInSearch> </FindServices>Setting
useFlatFields
on a DynamicForm
that is bound to this input
message schema would result in 5 FormItem
reflecting the 5 simple type
fields in the message.
For this form, the result of DynamicForm.getValues()
might look
like:
{ searchFor: "search text", caseSensitive: false, serviceName: true, documentation : true, keywords : true }When contacting a
WebService
, these values can be automatically
mapped to the structure of the input message for a web service operation by setting
useFlatFields
(for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)
) or by setting
useFlatFields
(for use with a DataSource
that is
'bound to a WSDL web service'
via
wsOperation
).
Using these two facilities in conjunction (component.useFlatFields and request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user presentation and when providing the data for XML messages.
You can also set useFlatFields
to automatically enable
"flattened" XML serialization (request.useFlatFields) for all DataSource requests of a
particular operationType.
Note that useFlatFields
is not generally recommended for use with structures
where multiple simple type fields exist with the same name, however if used with such a
structure, the first field to use a given name wins. "first" means the first field
encountered in a depth first search. "wins" means only the first field will be present as a
field when data binding.
getUseFlatFields
in interface DataBoundComponent
public void setHiliteProperty(String hiliteProperty)
DataBoundComponent
id
for a hilite defined on this component.
setHiliteProperty
in interface DataBoundComponent
hiliteProperty
- hiliteProperty Default value is "_hilite"public String getHiliteProperty()
DataBoundComponent
id
for a hilite defined on this component.
getHiliteProperty
in interface DataBoundComponent
public void editHilites()
editHilites
in interface DataBoundComponent
public String getHiliteState()
getHiliteState
in interface DataBoundComponent
public void setHiliteState(String hiliteState)
setHiliteState
in interface DataBoundComponent
hiliteState
- hilites state encoded as a Stringpublic void setHilites(Hilite[] hilites)
getHilites
for a method of
retrieving the hilite array for storage, including hilites manually added by the user.
setHilites
in interface DataBoundComponent
hilites
- array of hilite objectspublic Hilite[] getHilites()
getHilites
in interface DataBoundComponent
public void setDragDataAction(DragDataAction dragDataAction)
DataBoundComponent
setDragDataAction
in interface DataBoundComponent
dragDataAction
- dragDataAction Default value is Canvas.MOVEpublic DragDataAction getDragDataAction()
DataBoundComponent
getDragDataAction
in interface DataBoundComponent
public void setDragTrackerStyle(String dragTrackerStyle)
DataBoundComponent
setDragTrackerStyle
in interface DataBoundComponent
dragTrackerStyle
- dragTrackerStyle Default value is "gridDragTracker"public String getDragTrackerStyle()
DataBoundComponent
getDragTrackerStyle
in interface DataBoundComponent
public void setCanAddFormulaFields(Boolean canAddFormulaFields)
DataBoundComponent
com.smartgwt.client..FormulaBuilder
.
User-added formula fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
setCanAddFormulaFields
in interface DataBoundComponent
canAddFormulaFields
- canAddFormulaFields Default value is falsepublic void addSummaryField()
DataBoundComponent
com.smartgwt.client..SummaryBuilder
to create a new Summary Field. This
is equivalent to calling DataBoundComponentGen#editSummaryField
with
no parameter.
addSummaryField
in interface DataBoundComponent
public void addFormulaField()
DataBoundComponent
com.smartgwt.client..FormulaBuilder
to create a new Formula Field. This
is equivalent to calling DataBoundComponentGen#editFormulaField
with
no parameter.
addFormulaField
in interface DataBoundComponent
public Boolean getCanAddFormulaFields()
DataBoundComponent
com.smartgwt.client..FormulaBuilder
.
User-added formula fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
getCanAddFormulaFields
in interface DataBoundComponent
public void setAddFormulaFieldText(String addFormulaFieldText)
DataBoundComponent
setAddFormulaFieldText
in interface DataBoundComponent
addFormulaFieldText
- addFormulaFieldText Default value is "Add formula column..."public String getAddFormulaFieldText()
DataBoundComponent
getAddFormulaFieldText
in interface DataBoundComponent
public void setEditFormulaFieldText(String editFormulaFieldText)
DataBoundComponent
setEditFormulaFieldText
in interface DataBoundComponent
editFormulaFieldText
- editFormulaFieldText Default value is "Edit formula..."public String getEditFormulaFieldText()
DataBoundComponent
getEditFormulaFieldText
in interface DataBoundComponent
public void setCanAddSummaryFields(Boolean canAddSummaryFields)
DataBoundComponent
com.smartgwt.client..SummaryBuilder
.
User-added summary fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
setCanAddSummaryFields
in interface DataBoundComponent
canAddSummaryFields
- canAddSummaryFields Default value is falsepublic Boolean getCanAddSummaryFields()
DataBoundComponent
com.smartgwt.client..SummaryBuilder
.
User-added summary fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
getCanAddSummaryFields
in interface DataBoundComponent
public void setAddSummaryFieldText(String addSummaryFieldText)
DataBoundComponent
setAddSummaryFieldText
in interface DataBoundComponent
addSummaryFieldText
- addSummaryFieldText Default value is "Add summary column..."public String getAddSummaryFieldText()
DataBoundComponent
getAddSummaryFieldText
in interface DataBoundComponent
public void setEditSummaryFieldText(String editSummaryFieldText)
DataBoundComponent
setEditSummaryFieldText
in interface DataBoundComponent
editSummaryFieldText
- editSummaryFieldText Default value is "Edit summary format..."public String getEditSummaryFieldText()
DataBoundComponent
getEditSummaryFieldText
in interface DataBoundComponent
public void selectRecord(Record record)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectpublic void selectRecord(int record)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectpublic void selectRecord(int record, boolean newState)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)public void selectRecord(Record record, boolean newState)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)public void selectRecords(int[] records)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectpublic void selectRecords(int[] records, boolean newState)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectnewState
- new selection statepublic void selectRecords(Record[] records)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectpublic void selectRecords(Record[] records, boolean newState)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectnewState
- new selection state (if null, defaults to true)public void deselectRecord(Record record)
DataBoundComponent
Record
passed in explicitly, or by index. Synonym for
selectRecord(record, false)
deselectRecord
in interface DataBoundComponent
record
- record (or row number) to deselectpublic void deselectRecord(int record)
DataBoundComponent
Record
passed in explicitly, or by index. Synonym for
selectRecord(record, false)
deselectRecord
in interface DataBoundComponent
record
- record (or row number) to deselectpublic void deselectRecords(int[] records)
DataBoundComponent
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
deselectRecords
in interface DataBoundComponent
records
- records (or row numbers) to deselectpublic void deselectRecords(Record[] records)
DataBoundComponent
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
deselectRecords
in interface DataBoundComponent
records
- records (or row numbers) to deselectpublic void selectAllRecords()
DataBoundComponent
selectAllRecords
in interface DataBoundComponent
public void deselectAllRecords()
DataBoundComponent
deselectAllRecords
in interface DataBoundComponent
public Boolean anySelected()
DataBoundComponent
anySelected
in interface DataBoundComponent
public void enableHilite(String hiliteID)
DataBoundComponent
hilites
enableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to enablepublic void enableHilite(String hiliteID, boolean enable)
DataBoundComponent
hilites
enableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to enableenable
- new enabled state to apply - if null, defaults to truepublic void disableHilite(String hiliteID)
DataBoundComponent
disableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to disablepublic void enableHiliting()
DataBoundComponent
enableHiliting
in interface DataBoundComponent
public void enableHiliting(boolean enable)
DataBoundComponent
enableHiliting
in interface DataBoundComponent
enable
- new enabled state to apply - if null, defaults to truepublic void disableHiliting()
DataBoundComponent
disableHiliting
in interface DataBoundComponent
public Record[] getDragData()
DataBoundComponent
This method is consulted by
ListGrid.willAcceptDrop()
.
getDragData
in interface DataBoundComponent
Record
s that are currently selected.public void transferSelectedData(DataBoundComponent source)
DataBoundComponent
DataBoundComponent.getDropValues()
for each dropped record.
To transfer all data in, for example, a ListGrid
, call grid.selection.selectAll() first.
Note that drag/drop type transfers of records between components are asynchronous operations: Smart GWT may need to perform server turnarounds to establish whether
dropped records already exist in the target component. Therefore, it is possible to issue a call to transferSelectedData()
and/or the drop()
method of a databound component whilst a transfer is still active. When this happens, Smart GWT adds the second and subsequent transfer requests to a queue and runs
them one after the other. If you want to be notified when a transfer process has actually completed, use addDropCompleteHandler
.
See the Dragging
documentation for an overview of list grid drag/drop data transfer.
transferSelectedData
in interface DataBoundComponent
source
- source component from which the records will be tranferredpublic void transferSelectedData(DataBoundComponent source, int index)
DataBoundComponent
DataBoundComponent.getDropValues()
for each dropped record.
To transfer all data in, for example, a ListGrid
, call grid.selection.selectAll() first.
Note that drag/drop type transfers of records between components are asynchronous operations: Smart GWT may need to perform server turnarounds to establish whether
dropped records already exist in the target component. Therefore, it is possible to issue a call to transferSelectedData()
and/or the drop()
method of a databound component whilst a transfer is still active. When this happens, Smart GWT adds the second and subsequent transfer requests to a queue and runs
them one after the other. If you want to be notified when a transfer process has actually completed, use addDropCompleteHandler
.
See the Dragging
documentation for an overview of list grid drag/drop data transfer.
transferSelectedData
in interface DataBoundComponent
source
- source component from which the records will be tranferredindex
- target index (drop position) of the rows within this grid.public int getRecordIndex(Record record)
DataBoundComponent
Override in subclasses to provide more specific behaviour, for instance, when data holds a large number of records
getRecordIndex
in interface DataBoundComponent
record
- the record whose index is to be retrieved
public String getTitleFieldValue(Record record)
DataBoundComponent
Override in subclasses
getTitleFieldValue
in interface DataBoundComponent
record
- the record whose index is to be retrieved
public void setTitleField(String titleField)
DataBoundComponent
setTitleField
in interface DataBoundComponent
public String getTitleField()
DataBoundComponent
titleField
for databound
components."title"
,
"name"
, or "id"
. If we dont find any field-names that match these
titles, the first field in the component will be used instead.
getTitleField
in interface DataBoundComponent
public void setDataSource(DataSource dataSource)
DataBoundComponent
When binding a previously-bound componenet to a new DataSource, if the component has any existing "fields" or has a dataset, these will be discarded by default, since it is assumed the new DataSource may represent a completely unrelated set of objects. If the old "fields" are still relevant, you may be able to refer to setDataSource(dataSource, fields) as an alternative method if the widget has an implementation of it.
setDataSource
in interface DataBoundComponent
dataSource
- DataSource to bind to. Default value is nullpublic DataSource getDataSource()
DataBoundComponent
DataSource requests
.
getDataSource
in interface DataBoundComponent
public void setAutoFetchData(Boolean autoFetchData) throws IllegalStateException
DataBoundComponent
DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
depending on
DataBoundComponent.getAutoFetchAsFilter()
. Criteria for this fetch may be picked up from initialCriteria
and textMatchStyle may be specified via DataBoundComponent.getAutoFetchTextMatchStyle()
.
NOTE: If autoFetchData is set, calling ListGrid.fetchData() before draw will cause two requests to be
issued, one from the manual call to fetchData() and one from the autoFetchData setting. The second request will use only
initialCriteria
and not any other criteria or settings from the first request. Generally, turn off
autoFetchData if you are going to manually call fetchData() at any time.
setAutoFetchData
in interface DataBoundComponent
autoFetchData
- autoFetchData
IllegalStateException
public Boolean getAutoFetchData()
DataBoundComponent
DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
depending on
DataBoundComponent.getAutoFetchAsFilter()
. Criteria for this fetch may be picked up from initialCriteria
and textMatchStyle may be specified via DataBoundComponent.getAutoFetchTextMatchStyle()
.
NOTE: If autoFetchData is set, calling ListGrid.fetchData() before draw will cause two requests to be
issued, one from the manual call to fetchData() and one from the autoFetchData setting. The second request will use only
initialCriteria
and not any other criteria or settings from the first request. Generally, turn off
autoFetchData if you are going to manually call fetchData() at any time.
getAutoFetchData
in interface DataBoundComponent
public void setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle) throws IllegalStateException
DataBoundComponent
autoFetchData
is true
, this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData()
call.
setAutoFetchTextMatchStyle
in interface DataBoundComponent
IllegalStateException
public TextMatchStyle getAutoFetchTextMatchStyle()
DataBoundComponent
autoFetchData
is true
, this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData()
call.
getAutoFetchTextMatchStyle
in interface DataBoundComponent
public void setAutoFetchAsFilter(Boolean autoFetchAsFilter) throws IllegalStateException
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
setAutoFetchAsFilter
in interface DataBoundComponent
autoFetchAsFilter
- autoFetchAsFilter
IllegalStateException
public Boolean getAutoFetchAsFilter()
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
getAutoFetchAsFilter
in interface DataBoundComponent
public void setInitialCriteria(Criteria initialCriteria) throws IllegalStateException
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is used.
setInitialCriteria
in interface DataBoundComponent
initialCriteria
- the initial criteria
IllegalStateException
- this property cannot be changed after the component has been createdpublic Criteria getInitialCriteria()
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is used.
getInitialCriteria
in interface DataBoundComponent
public void fetchData()
DataBoundComponent
When fetchData()
is first called, if data has not already been provided via
setData()
, this method will create a ResultSet
, which will be
configured based on component settings such as fetchOperation
and dataPageSize
, as well
as the general purpose dataProperties
. The created ResultSet will automatically send a DSRequest
to retrieve data from the dataSource, and from then on will
automatically manage paging through large datasets, as well as performing filtering and
sorting operations inside the browser when possible - see the ResultSet docs for
details.
NOTE: do not use both autoFetchData
and a
call to fetchData()
- this may result in two DSRequests to fetch data. Use
either autoFetchData
and setAutoFetchCriteria()
or a manual call to fetchData()
passing criteria.
Whether a ResultSet was automatically created or provided via setData()
, subsequent
calls to fetchData() will simply call resultSet.setCriteria()
.
Changes to criteria may or may not result in a DSRequest to the server due to
client-side filtering. You can call
willFetchData(criteria)
to determine if new criteria will
result in a server fetch.
If you need to force data to be re-fetched, you can call
invalidateCache()
and new data will
automatically be fetched from the server using the current criteria and sort direction. NOTE:
when using invalidateCache()
there is no need to also call fetchData()
and in fact this could produce unexpected results.
This method takes an optional callback parameter (set to a DSCallback
)
to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed.
In this case the data is updated synchronously, so as soon as this method completes you
can interact with the new data. If necessary, you can use
resultSet.willFetchData()
to determine whether or not a server
fetch will occur when fetchData()
is called with new criteria.
In addition to the callback parameter for this method, developers can use
resultSet.addDataArrivedHandler
to be notified every time data is loaded.
fetchData
in interface DataBoundComponent
public void fetchData(Criteria criteria)
DataBoundComponent
When fetchData()
is first called, if data has not already been provided via
setData()
, this method will create a ResultSet
, which will be
configured based on component settings such as fetchOperation
and dataPageSize
, as well
as the general purpose dataProperties
. The created ResultSet will automatically send a DSRequest
to retrieve data from the dataSource, and from then on will
automatically manage paging through large datasets, as well as performing filtering and
sorting operations inside the browser when possible - see the ResultSet docs for
details.
NOTE: do not use both autoFetchData
and a
call to fetchData()
- this may result in two DSRequests to fetch data. Use
either autoFetchData
and setAutoFetchCriteria()
or a manual call to fetchData()
passing criteria.
Whether a ResultSet was automatically created or provided via setData()
, subsequent
calls to fetchData() will simply call resultSet.setCriteria()
.
Changes to criteria may or may not result in a DSRequest to the server due to
client-side filtering. You can call
willFetchData(criteria)
to determine if new criteria will
result in a server fetch.
If you need to force data to be re-fetched, you can call
invalidateCache()
and new data will
automatically be fetched from the server using the current criteria and sort direction. NOTE:
when using invalidateCache()
there is no need to also call fetchData()
and in fact this could produce unexpected results.
This method takes an optional callback parameter (set to a DSCallback
)
to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed.
In this case the data is updated synchronously, so as soon as this method completes you
can interact with the new data. If necessary, you can use
resultSet.willFetchData()
to determine whether or not a server
fetch will occur when fetchData()
is called with new criteria.
In addition to the callback parameter for this method, developers can use
resultSet.addDataArrivedHandler
to be notified every time data is loaded.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling DynamicForm.getValuesAsCriteria()
public void fetchData(Criteria criteria, DSCallback callback)
DataBoundComponent
When fetchData()
is first called, if data has not already been provided via
setData()
, this method will create a ResultSet
, which will be
configured based on component settings such as fetchOperation
and dataPageSize
, as well
as the general purpose dataProperties
. The created ResultSet will automatically send a DSRequest
to retrieve data from the dataSource, and from then on will
automatically manage paging through large datasets, as well as performing filtering and
sorting operations inside the browser when possible - see the ResultSet docs for
details.
NOTE: do not use both autoFetchData
and a
call to fetchData()
- this may result in two DSRequests to fetch data. Use
either autoFetchData
and setAutoFetchCriteria()
or a manual call to fetchData()
passing criteria.
Whether a ResultSet was automatically created or provided via setData()
, subsequent
calls to fetchData() will simply call resultSet.setCriteria()
.
Changes to criteria may or may not result in a DSRequest to the server due to
client-side filtering. You can call
willFetchData(criteria)
to determine if new criteria will
result in a server fetch.
If you need to force data to be re-fetched, you can call
invalidateCache()
and new data will
automatically be fetched from the server using the current criteria and sort direction. NOTE:
when using invalidateCache()
there is no need to also call fetchData()
and in fact this could produce unexpected results.
This method takes an optional callback parameter (set to a DSCallback
)
to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed.
In this case the data is updated synchronously, so as soon as this method completes you
can interact with the new data. If necessary, you can use
resultSet.willFetchData()
to determine whether or not a server
fetch will occur when fetchData()
is called with new criteria.
In addition to the callback parameter for this method, developers can use
resultSet.addDataArrivedHandler
to be notified every time data is loaded.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires only
if server contact was requiredpublic void fetchData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
DataBoundComponent
When fetchData()
is first called, if data has not already been provided via
setData()
, this method will create a ResultSet
, which will be
configured based on component settings such as fetchOperation
and dataPageSize
, as well
as the general purpose dataProperties
. The created ResultSet will automatically send a DSRequest
to retrieve data from the dataSource, and from then on will
automatically manage paging through large datasets, as well as performing filtering and
sorting operations inside the browser when possible - see the ResultSet docs for
details.
NOTE: do not use both autoFetchData
and a
call to fetchData()
- this may result in two DSRequests to fetch data. Use
either autoFetchData
and setAutoFetchCriteria()
or a manual call to fetchData()
passing criteria.
Whether a ResultSet was automatically created or provided via setData()
, subsequent
calls to fetchData() will simply call resultSet.setCriteria()
.
Changes to criteria may or may not result in a DSRequest to the server due to
client-side filtering. You can call
willFetchData(criteria)
to determine if new criteria will
result in a server fetch.
If you need to force data to be re-fetched, you can call
invalidateCache()
and new data will
automatically be fetched from the server using the current criteria and sort direction. NOTE:
when using invalidateCache()
there is no need to also call fetchData()
and in fact this could produce unexpected results.
This method takes an optional callback parameter (set to a DSCallback
)
to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed.
In this case the data is updated synchronously, so as soon as this method completes you
can interact with the new data. If necessary, you can use
resultSet.willFetchData()
to determine whether or not a server
fetch will occur when fetchData()
is called with new criteria.
In addition to the callback parameter for this method, developers can use
resultSet.addDataArrivedHandler
to be notified every time data is loaded.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was requiredrequestProperties
- additional properties to set on the DSRequest
that will be issuedpublic void filterData()
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
public void filterData(Criteria criteria)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling DynamicForm.getValuesAsCriteria()
public void filterData(Criteria criteria, DSCallback callback)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was required; see
DataBoundComponent.fetchData()
for detailspublic void filterData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was required; see
DataBoundComponent.fetchData()
for detailsrequestProperties
- for databound components only - optional additional
properties to set on the DSRequest that will be issuedpublic void invalidateCache()
DataBoundComponent
this.data.invalidateCache()
. If necessary, this will cause a new fetch to
be performed with the current set of criteria for this component.
Has no effect if this component is not showing a set of filtered data.
invalidateCache
in interface DataBoundComponent
public ResultSet getResultSet()
DataBoundComponent
ResultSet
.
Note that this method should only be called after initial data has been fetched by this DataBoundComponent.
getResultSet
in interface DataBoundComponent
DataBoundComponent.fetchData()
public RecordList getRecordList()
DataBoundComponent
RecordList
.
Depending on the component configuration, the actual JavaScript instance of the returned RecordList may be one of several types:
DataSource
,
the instance is generally an Array of Record
.ResultSet
.Tree
.
To access the ungrouped record list regardless of grouping status, use
isGrouped() ? getOriginalRecordList() : getRecordList()
TreeGrid
,
the instance is a ResultTree.
getRecordList
in interface DataBoundComponent
public void exportData()
DataBoundComponent
DataSource
to retrieve data that matches the current filter and sort criteria for this component, then exports the resulting data
to a file or window in the requested format. A variety of DSRequest settings, such as exportAs
and exportFilename
, affect the exporting process: see exportResults
for further detail.
Note that data exported via this method does not include any client-side
formatting and relies on both the Smart GWT server and server-side DataSources. To export client-data with formatters
applied, see exportClientData
, which still
requires the Smart GWT server but does not rely on server-side DataSources.
For more information on exporting data,
see DataSource.exportData
.
exportData
in interface DataBoundComponent
DataBoundComponentMethods overview and related methods
public void exportData(DSRequest requestProperties)
DataBoundComponent
DataSource
to retrieve data that matches the current filter and sort criteria for this component, then exports the resulting data
to a file or window in the requested format. A variety of DSRequest settings, such as exportAs
and exportFilename
, affect the exporting process: see exportResults
for further detail.
Note that data exported via this method does not include any client-side
formatting and relies on both the Smart GWT server and server-side DataSources. To export client-data with formatters
applied, see exportClientData
, which still
requires the Smart GWT server but does not rely on server-side DataSources.
For more information on exporting data,
see DataSource.exportData
.
exportData
in interface DataBoundComponent
requestProperties
- additional properties to set on the DSRequest that will be issuedDataBoundComponentMethods overview and related methods
public void exportClientData()
DataBoundComponent
To export unformatted data from this component's dataSource, see
exportData
which does not include client-side formatters,
but relies on both the SmartClient server and server-side DataSources.
exportClientData
in interface DataBoundComponent
DataSource.exportClientData(java.lang.Object[], com.smartgwt.client.data.DSRequest)
public void exportClientData(DSRequest requestProperties)
DataBoundComponent
To export unformatted data from this component's dataSource, see
exportData
which does not include client-side formatters,
but relies on both the SmartClient server and server-side DataSources.
exportClientData
in interface DataBoundComponent
requestProperties
- Request properties for the exportDataSource.exportClientData(java.lang.Object[], com.smartgwt.client.data.DSRequest)
public HandlerRegistration addFetchDataHandler(FetchDataHandler handler)
Notification function fired on fetchData() or filterData()
addFetchDataHandler
in interface HasFetchDataHandlers
handler
- the filterData handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addDropCompleteHandler(DropCompleteHandler handler)
com.smartgwt.client.widgets.DropCompleteHandler
. See that class's documentation for a definition of "drop complete",
and how it differs from "drag complete" (com.smartgwt.client.widgets.DragCompleteHandler
).
addDropCompleteHandler
in interface HasDropCompleteHandlers
handler
- the DropCompleteHandler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addDragCompleteHandler(DragCompleteHandler handler)
com.smartgwt.client.widgets.DragCompleteHandler
. See that class's documentation for a definition of "drag complete",
and how it differs from "drop complete" (com.smartgwt.client.widgets.DropCompleteHandler
).
addDragCompleteHandler
in interface HasDragCompleteHandlers
handler
- the DropCompleteHandler
HandlerRegistration
used to remove this handlerpublic com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.calendar.CalendarLogicalStructure s)
public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
getLogicalStructure
in interface LogicalStructure
getLogicalStructure
in class Canvas
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |