ArgGroups.js 1.43 KB
/**
  * 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'
  
});