3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
8 * @class Ext.calendar.EventMappings
10 * A simple object that provides the field definitions for EventRecords so that they can be easily overridden.
12 Ext.calendar.EventMappings = {
73 * @class Ext.calendar.EventRecord
74 * @extends Ext.data.Record
75 * <p>This is the {@link Ext.data.Record Record} specification for calendar event data used by the
76 * {@link Ext.calendar.CalendarPanel CalendarPanel}'s underlying store. It can be overridden as
77 * necessary to customize the fields supported by events, although the existing column names should
78 * not be altered. If your model fields are named differently you should update the <b>mapping</b>
79 * configs accordingly.</p>
80 * <p>The only required fields when creating a new event record instance are StartDate and
81 * EndDate. All other fields are either optional are will be defaulted if blank.</p>
82 * <p>Here is a basic example for how to create a new record of this type:<pre><code>
83 rec = new Ext.calendar.EventRecord({
84 StartDate: '2101-01-12 12:00:00',
85 EndDate: '2101-01-12 13:30:00',
86 Title: 'My cool event',
90 * If you have overridden any of the record's data mappings via the Ext.calendar.EventMappings object
91 * you may need to set the values using this alternate syntax to ensure that the fields match up correctly:<pre><code>
92 var M = Ext.calendar.EventMappings;
94 rec = new Ext.calendar.EventRecord();
95 rec.data[M.StartDate.name] = '2101-01-12 12:00:00';
96 rec.data[M.EndDate.name] = '2101-01-12 13:30:00';
97 rec.data[M.Title.name] = 'My cool event';
98 rec.data[M.Notes.name] = 'Some notes';
101 * @param {Object} data (Optional) An object, the properties of which provide values for the new Record's
102 * fields. If not specified the {@link Ext.data.Field#defaultValue defaultValue}
103 * for each field will be assigned.
104 * @param {Object} id (Optional) The id of the Record. The id is used by the
105 * {@link Ext.data.Store} object which owns the Record to index its collection
106 * of Records (therefore this id should be unique within each store). If an
107 * id is not specified a {@link #phantom}
108 * Record will be created with an {@link #Record.id automatically generated id}.
111 var M = Ext.calendar.EventMappings;
113 Ext.calendar.EventRecord = Ext.data.Record.create([
128 * Reconfigures the default record definition based on the current Ext.calendar.EventMappings object
130 Ext.calendar.EventRecord.reconfigure = function() {
131 Ext.calendar.EventRecord = Ext.data.Record.create([