Function.js
1.23 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Project : AMDA-NG
* Name : Function.js
* @plugin amdaModel.Function
* @extends Ext.data.Model
* @brief Data model for functions definition
* @author Benjamin
*/
Ext.define('amdaModel.Function', {
extend: 'Ext.data.Model',
idProperty: 'text',
fields : [
{name: 'name', mapping: '@name', type:'string'},
{name: 'kind', mapping: '@kind', type: 'string', defaultValue: 'amda'},
{name: 'group', mapping: '@group', type: 'string', defaultValue: 'space'},
{name: 'args', mapping: '@args', type: 'int', defaultValue: 1},
{name: 'argv', mapping: '@argv', type: 'string'},
{name: 'prompt', type: 'string', defaultValue: ''},
{name: 'prompt_param', type: 'string', defaultValue: ''},
{name: 'default_args', type: 'string', defaultValue: ''},
{name: 'info_brief', type: 'string', defaultValue: ''}
],
validations: [
{type: 'presence', field: 'name'},
{type: 'presence', field: 'kind'},
{type: 'presence', field: 'group'}/*,
{type: 'inclusion', field: 'kind', list: ['amda','time']}*/
],
proxy: {
type: 'ajax',
url : 'generic_data/Functions/functions.xml',
reader: {
type: 'xml',
root: 'functions',
record: 'function'
}
}
});