Properties Methods Events Direct Link

# Class Ext.ensible.cal.CalendarRecord

Package: | Ext.ensible.cal
Defined In: | CalendarRecord.js
Class: | CalendarRecord
Extends: | Object

This is the Record specification for calendar items used by the CalendarPanel's calendar store. If your model fields are named differently you should update the mapping configs accordingly.

The only required fields when creating a new calendar record instance are CalendarId and Title. All other fields are either optional or will be defaulted if blank.

Here is a basic example for how to create a new record of this type:

    rec = new Ext.ensible.cal.CalendarRecord({
        CalendarId: 5,
        Title: 'My Holidays',
        Description: 'My personal holiday schedule',
        ColorId: 3
    });

If you have overridden any of the record's data mappings via the CalendarMappings object you may need to set the values using this alternate syntax to ensure that the fields match up correctly:

    var M = Ext.ensible.cal.CalendarMappings;

    rec = new Ext.ensible.cal.CalendarRecord();
    rec.data[M.CalendarId.name] = 5;
    rec.data[M.Title.name] = 'My Holidays';
    rec.data[M.Description.name] = 'My personal holiday schedule';
    rec.data[M.ColorId.name] = 3;

## Public Properties

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---
| CalendarRecord( [`Object data`], [`Object id`] ) Parameters: `data` : Object (Optional) An object, the properties of which provide values for the new Record's fields. If not specified the defaultValue for each field will be assigned. `id` : Object (Optional) The id of the Record. The id is used by the Ext.data.Store object which owns the Record to index its collection of Records (therefore this id should be unique within each store). If an id is not specified a phantom Record will be created with an automatically generated id. Returns: void | CalendarRecord
| create() : Function <static> Reconfigures the default record definition based on the current CalendarMappings object. See the header documentation... <static> Reconfigures the default record definition based on the current CalendarMappings object. See the header documentation for Ext.ensible.cal.CalendarMappings for complete details and examples of reconfiguring a CalendarRecord. Parameters: None. Returns: `Function` The updated CalendarRecord constructor function | CalendarRecord

## Public Events

This class has no public events.