Event selecting

Air calendar supports dynamic selection. User can click and drag to select a period of time to create an event. Below are the actions, triggers and states associated with selection.

To enable selection check the element property Event and days are selectable . Once enabled the following states, triggers and actions can be used.

When selection is enabled, clicking on a cell triggers the selection is made event as well as the date clicked event. If you don't want your users to click to select but instead click and drag to select, you have to change the element property, Select min distance to a value greater than 0.

States

selected start date : The start date/time of the current selection. The value is a date.

selected end date : The end date/time of the current selection. The value is a date.

selection all day? : This is a boolean (yes/no) that tells you if the selection occurred in an All Day (yes) cell or a timed cell (no).

selected cells id attribute : This is the html element ID attribute of the selected region. You can use this as reference to show a context menu. NB: This is an advanced property so only use if you understand what you're doing.

Triggers

selection is made : Triggered when a selection has been made. Once this event occurs the states defined above are available and can be used in a workflow. For example you may want to show a popup with the selected dates to create an event in your database.

Actions

Air calendar allows allows you to programmatically select or cancel a selection. This is useful if after the user has selected an area decides to change the start or end time (see demo at the start of this page). The following actions are provided.

Select: Selects a period of time on the calendar. It has following 3 fields

start date - Start date of the selection. Value should be date. end date - End of the selection. Optional. Default slot value will be used. Value should be a date. This value is exclusive, meaning if you want to your last full-day selection to be Thursday, then specify Friday All day - Specify if selection should happen in the All Day slot. Optional. Default is false.

Unselect: Cancels the current selection. It doesn't have any fields.

Last updated