Upgrade to ExtJS 3.3.1 - Released 11/30/2010
[extjs.git] / examples / docs / output / Ext.calendar.EventRecord.html
1 <div class="body-wrap" xmlns:ext="http://www.extjs.com"><div class="top-tools"><a class="inner-link" href="#Ext.calendar.EventRecord-props"><img src="resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>&#13;<a class="inner-link" href="#Ext.calendar.EventRecord-methods"><img src="resources/images/default/s.gif" class="item-icon icon-method">Methods</a>&#13;<a class="inner-link" href="#Ext.calendar.EventRecord-events"><img src="resources/images/default/s.gif" class="item-icon icon-event">Events</a>&#13;<a class="bookmark" href="../docs/?class=Ext.calendar.EventRecord"><img src="resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>&#13;</div><h1>Class <a href="source/EventRecord.html#cls-Ext.calendar.EventRecord">Ext.calendar.EventRecord</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.calendar</td></tr><tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/EventRecord.html#cls-Ext.calendar.EventRecord">EventRecord.js</a></td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/EventRecord.html#cls-Ext.calendar.EventRecord">EventRecord</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr></table><div class="description"><p>This is the <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Record</a> specification for calendar event data used by the
2 <a href="output/Ext.calendar.CalendarPanel.html" ext:cls="Ext.calendar.CalendarPanel">CalendarPanel</a>'s underlying store. It can be overridden as 
3 necessary to customize the fields supported by events, although the existing column names should
4 not be altered. If your model fields are named differently you should update the <b>mapping</b>
5 configs accordingly.</p>
6 <p>The only required fields when creating a new event record instance are StartDate and
7 EndDate.  All other fields are either optional are will be defaulted if blank.</p>
8 <p>Here is a basic example for how to create a new record of this type:<pre><code>rec = <b>new</b> Ext.calendar.EventRecord({
9     StartDate: <em>'2101-01-12 12:00:00'</em>,
10     EndDate: <em>'2101-01-12 13:30:00'</em>,
11     Title: <em>'My cool event'</em>,
12     Notes: <em>'Some notes'</em>
13 });</code></pre>
14 If you have overridden any of the record's data mappings via the Ext.calendar.EventMappings object
15 you may need to set the values using this alternate syntax to ensure that the fields match up correctly:<pre><code><b>var</b> M = Ext.calendar.EventMappings;
16
17 rec = <b>new</b> Ext.calendar.EventRecord();
18 rec.data[M.StartDate.name] = <em>'2101-01-12 12:00:00'</em>;
19 rec.data[M.EndDate.name] = <em>'2101-01-12 13:30:00'</em>;
20 rec.data[M.Title.name] = <em>'My cool event'</em>;
21 rec.data[M.Notes.name] = <em>'Some notes'</em>;</code></pre></div><div class="hr"></div><a id="Ext.calendar.EventRecord-props"></a><h2>Public Properties</h2><div class="no-members">This class has no public properties.</div><a id="Ext.calendar.EventRecord-methods"></a><h2>Public Methods</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Method</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.calendar.EventRecord-EventRecord"></a><b><a href="source/EventRecord.html#cls-Ext.calendar.EventRecord">EventRecord</a></b>(&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;data</code>]</span>,&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;id</code>]</span>&nbsp;)
22     <div class="mdesc"><div class="short"></div><div class="long"><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>data</code> : Object<div class="sub-desc">(Optional) An object, the properties of which provide values for the new Record's
23 fields. If not specified the <a href="output/Ext.data.Field.html#Ext.data.Field-defaultValue" ext:member="defaultValue" ext:cls="Ext.data.Field">defaultValue</a>
24 for each field will be assigned.</div></li><li><code>id</code> : Object<div class="sub-desc">(Optional) The id of the Record. The id is used by the
25 <a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">Ext.data.Store</a> object which owns the Record to index its collection
26 of Records (therefore this id should be unique within each store). If an
27 id is not specified a <a href="output/Ext.calendar.EventRecord.html#Ext.calendar.EventRecord-phantom" ext:member="phantom" ext:cls="Ext.calendar.EventRecord">phantom</a>
28 Record will be created with an <a href="output/Ext.calendar.EventRecord.html#Ext.calendar.EventRecord-Record.id" ext:member="Record.id" ext:cls="Ext.calendar.EventRecord">automatically generated id</a>.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">EventRecord</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.calendar.EventRecord-EventRecord.reconfigure"></a><b><a href="source/EventRecord.html#method-Ext.calendar.EventRecord-EventRecord.reconfigure">EventRecord.reconfigure</a></b>()
29     :
30                                         void<div class="mdesc"><div class="short">Reconfigures the default record definition based on the current Ext.calendar.EventMappings object</div><div class="long">Reconfigures the default record definition based on the current Ext.calendar.EventMappings object<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">EventRecord</td></tr></tbody></table><a id="Ext.calendar.EventRecord-events"></a><h2>Public Events</h2><div class="no-members">This class has no public events.</div></div>