]> git.proxmox.com Git - extjs.git/blame - extjs/examples/classic/calendar/src/data/CalendarModel.js
add extjs 6.0.1 sources
[extjs.git] / extjs / examples / classic / calendar / src / data / CalendarModel.js
CommitLineData
6527f429
DM
1Ext.define('Ext.calendar.data.CalendarModel', {\r
2 extend: 'Ext.data.Model',\r
3 \r
4 requires: [\r
5 'Ext.calendar.data.CalendarMappings'\r
6 ],\r
7 \r
8 identifier: 'sequential',\r
9 \r
10 statics: {\r
11 /**\r
12 * Reconfigures the default record definition based on the current {@link Ext.calendar.data.CalendarMappings CalendarMappings}\r
13 * object. See the header documentation for {@link Ext.calendar.data.CalendarMappings} for complete details and \r
14 * examples of reconfiguring a CalendarRecord.\r
15 *\r
16 * **NOTE**: Calling this method will *not* update derived class fields. To ensure\r
17 * updates are made before derived classes are defined as an override. See the\r
18 * documentation of `Ext.calendar.data.CalendarMappings`.\r
19 *\r
20 * @static\r
21 * @return {Class} The updated CalendarModel\r
22 */\r
23 reconfigure: function(){\r
24 var me = this,\r
25 Mappings = Ext.calendar.data.CalendarMappings;\r
26\r
27 // It is critical that the id property mapping is updated in case it changed, since it\r
28 // is used elsewhere in the data package to match records on CRUD actions:\r
29 me.prototype.idProperty = Mappings.CalendarId.name || 'id';\r
30\r
31 me.replaceFields(Ext.Object.getValues(Mappings), true);\r
32\r
33 return me;\r
34 }\r
35 }\r
36},\r
37function() {\r
38 this.reconfigure();\r
39});\r