Constant.js
1.18 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 : Constant.js
* @plugin amdaModel.Constant
* @extends Ext.data.Model
* @brief Data model for constants definition
* @author Benjamin
* @version $Id: Constant.js 1383 2013-03-25 09:30:27Z elena $
********************************************************************************
* FT Id : Date : Name - Description
*******************************************************************************
* :
*/
Ext.define('amdaModel.Constant', {
extend: 'Ext.data.Model',
idProperty: 'name',
fields : [
{name: 'name', mapping: '@name', type:'string'},
{name: 'kind', mapping: '@kind', type: 'string', defaultValue: 'space'},
{name: 'info', mapping: '@info', type:'string'},
{name: 'units', mapping: '@units', type: 'string', defaultValue: ''},
{name: 'value', mapping: ' ', type: 'string'}
],
validations: [
{type: 'presence', field: 'value'}
],
proxy: {
type: 'ajax',
//TODO url into general settings
url : 'generic_data/Functions/constants.xml',
reader: {
type: 'xml',
root: 'constants',
record: 'constant'
}
}
});