Events scheduled to occur at an appointed time are represented on the client side in MindFusion.Scheduling for ASP.NET by the Item class. Item comprises the information that should be defined for all schedule events. For example, the values returned from the getStartTime and getEndTime methods represent the time and duration of an event. The getRecurrence method lets you view the Recurrence object, associated with this item instance. There are several other descriptive functions that can provide additional information about an item, such as getPriority, getHeaderText, getDescriptionText and so forth.
It is possible for an Item to be associated with resources such as Resource, Contact, Location or Task. The id(s) of the associated resource(s) can be obtained by calling getResources, getContacts, getLocation or getTask respectively.
There are various ways to access one or more items defined in a MindFusion.Scheduling for ASP.NET Calendar from the client. The getItems method returns a collection, containing all the items, currently present in the calendar's schedule. Currently selected items are accessible from the getItemSelection function. Cell objects also contain references to their associated items, which can be accessed through the getCellItems, getCueCellItems, getHeaderItems or getCueHeaderItems. Particular item or items can be accessed through id by calling getItemById or through the id of an associated resource with getItemsByResourceId.
In order to programatically set values to one or more of the Item's properties, the createItem and editItem methods should be used, by passing as argument an object which defines the values of some of these properties.
This is a complete table of the names of the item's properties, which can be set programatically from the client side:
Name | Value type | Description |
---|---|---|
startTime | Represents the start time of an event. | |
endTime | Represents the end time of an event. | |
contacts | Array | Represents a collection, containing the ids of any associated Contact objects. |
location | String | Represents the id of an associated Location object. |
task | String | Represents the id of an associated Task object. |
resources | Array | Represents a collection, containing the ids of any associated Resource objects. |
cssClass | String | Represents the name of a user defined CSS Class, used to visually style the item. |
allowChangeStart | Boolean | Specifies whether the item's start time can be modified by interactive resize. |
allowChangeEnd | Boolean | Specifies whether the item's end time can be modified by interactive resize. |
allowMove | Boolean | Specifies whether the item can be moved interactively. |
locked | Boolean | Specifies whether the user can interact with the item. |
allDayEvent | Boolean | Specifies whether the item is defined as an all-day event or not. |
subject | String | Represents the item's header text. |
details | String | Represents the item's description text. |
reminder | Represents a Reminder object, associated with the item. | |
recurrence | Represents a recurrent pattern, associated with the item. | |
priority | Number | Represents a user defined priority, used in the order in which items appear in the calendar. |
visible | Boolean | Specifies whether the item is visible in the calendar. |
tag | Object | Represents a custom field used for storing user defined data. |
New items can be added programatically on the client side by calling Calendar's createItem method.
The following function will create and add to the calendar an Item, which starts at 09:00 of the current day, with a duration of 9 hours, its header text will display "new item".
JavaScript
![]() |
---|
function create() { |
Items can be edited programatically on the client side by calling Calendar's editItem method. The item parameter should be the edited item, and the args parameter should be an Object, containing the changed properties.
The following function will edit the currently selected item, by assigning a recurrence pattern to it and changing its description text:
![]() |
---|
You can find details about programatically creating recurrence patterns in the Recurrences on the Client topic. |
JavaScript
![]() |
---|
funcion edit() { |
Items can be deleted programatically on the client side by calling Calendar's deleteItem method. For example:
JavaScript
![]() |
---|
function delete() { |
Recurrence series can also be removed from the Calendar by deleting the Recurrence master:
JavaScript
![]() |
---|
function deleteRecurrence() { |