]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /*\r |
2 | * A simple reusable store that loads static calendar field definitions into memory\r | |
3 | * and can be bound to the CalendarCombo widget and used for calendar color selection.\r | |
4 | */\r | |
5 | Ext.define('Ext.calendar.data.MemoryCalendarStore', {\r | |
6 | extend: 'Ext.data.Store',\r | |
7 | model: 'Ext.calendar.data.CalendarModel',\r | |
8 | \r | |
9 | requires: [\r | |
10 | 'Ext.data.proxy.Memory',\r | |
11 | 'Ext.data.reader.Json',\r | |
12 | 'Ext.data.writer.Json',\r | |
13 | 'Ext.calendar.data.CalendarModel',\r | |
14 | 'Ext.calendar.data.CalendarMappings'\r | |
15 | ],\r | |
16 | \r | |
17 | proxy: {\r | |
18 | type: 'memory',\r | |
19 | reader: {\r | |
20 | type: 'json',\r | |
21 | rootProperty: 'calendars'\r | |
22 | },\r | |
23 | writer: {\r | |
24 | type: 'json'\r | |
25 | }\r | |
26 | },\r | |
27 | \r | |
28 | autoLoad: true,\r | |
29 | \r | |
30 | initComponent: function() {\r | |
31 | var me = this,\r | |
32 | calendarData = Ext.calendar.data;\r | |
33 | \r | |
34 | me.sorters = me.sorters || [{\r | |
35 | property: calendarData.CalendarMappings.Title.name,\r | |
36 | direction: 'ASC'\r | |
37 | }];\r | |
38 | \r | |
39 | me.idProperty = me.idProperty || calendarData.CalendarMappings.CalendarId.name || 'id';\r | |
40 | \r | |
41 | me.fields = calendarData.CalendarModel.prototype.fields.getRange();\r | |
42 | \r | |
43 | me.callParent(arguments);\r | |
44 | }\r | |
45 | }); |