1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| Ext.define('SimpleTasks.model.List', {
| extend: 'Ext.data.Model',
| requires:[
| 'Ext.data.proxy.LocalStorage',
| 'Ext.data.proxy.Ajax'
| ],
| fields: [
| { name: 'id', type: 'int' },
| { name: 'name' },
| // if we are using local storage, we need to persist the index field so the ordering of tree nodes will be preserved
| {name: 'index', type: 'int', defaultValue: null, persist: !!SimpleTasksSettings.useLocalStorage}
| ],
|
| proxy: SimpleTasksSettings.useLocalStorage ? {
| type: 'localstorage',
| id: 'SimpleTasks-List'
| } : {
| type: 'ajax',
| api: {
| create: 'php/list/create.php',
| read: 'php/list/read.php',
| update: 'php/list/update.php',
| destroy: 'php/list/delete.php'
| },
|
| reader: {
| type: 'json',
| messageProperty: 'message'
| }
| }
| });
|
|