Constant.js 1.1 KB
/**
  * 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: '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'
      }
  }
});