Blame view

js/app/models/ArgGroups.js 1.43 KB
16035364   Benjamin Renard   First commit
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
44
45
46
47
48
49
50
/**
  * Project      :  AMDA-NG
  * Name         :   
  * @extends 	  Ext.data.Model
  * @brief		  
  * @author 
  * @version $Id: ArgGroups.js 857 2012-03-28 16:18:45Z elena $
  ********************************************************************************
  *    FT Id     :   Date   : Name - Description
  *******************************************************************************
  *  :          
  */

Ext.define('amdaModel.ArgGroups', {	
  extend: 'Ext.data.Model',
// simple args, plotSetting args, table (spectra) args  
// every group is shown as fieldset
  fields : [ 'group', 'groupS', 'groupE', 'groupEmulti', 'units'],
  
  hasMany: {model: 'amdaModel.Args', name: 'args'},
   
  proxy: {
      type: 'ajax',    
      url : 'php/arguments.php',
// send parameterID to find parameter description XML @ server      
      extraParams : {'paramID' : ''},
      reader: {
          type: 'json'
      }
  }
});

Ext.define('amdaModel.Args', {	
  extend: 'Ext.data.Model',
// for combo: generate [name, value] array  
  fields : [  'arg',  
	     { name: 'value',
	       convert: function(value, rec){
                return value ? value : rec.get('arg');
             }}/*,
	      { name: 'display',
	        convert: function(value, rec){
                return  rec.get('value') != rec.get('arg') ? rec.get('arg') + ' -> ' + rec.get('value') : rec.get('arg');
             }}
             */
	   ],
  
  belongsTo: 'amdaModel.ArgGroups'
  
});