StatisticsModule.js 1.52 KB
/**
 * Project   AMDA-NG
 * Name      StatisticsModule.js
 * @class    amdaDesktop.StatisticsModule
 * @extends  amdaDesktop.InteractiveModule
 * @brief    Statistics Module controller definition 
 * @author   elena
 */

Ext.define('amdaDesktop.StatisticsModule', {
	extend: 'amdaDesktop.InteractiveModule',
	
	 requires: [
         'amdaUI.StatisticsUI'
     ],
     
      contentId : 'statisticsUI',
      
    /**
     * @cfg {String} data models
     * @required
     */
	nodeDataModel : 'amdaModel.StatisticsNode',
	objectDataModel : 'amdaModel.Statistics',
    /**
     * @cfg {String} window definitions
     * @required
     */
	width : 550,
	height: 550,
	uiType : 'panelStatistics',
	helpTitle : 'Help on Statistics Module',
	helpFile : 'statisticsHelp',
    /**	
     * @override
     */
    createWindow : function() {
        if (!this.linkedNode){
            this.setLinkedNode(amdaModel.StatisticsNode);
        }
        this.callParent(arguments);
    },
	 
	 saveState: function() {
            var uiContent = this.getUiContent();               
            var form = uiContent.down('form').getForm();
            var values = form.getValues();                
            //   Ext.state.Manager.set(this.id + '_form', values);
            Ext.state.Manager.set('timeinterval', {'startDate' : values.startDate,'stopDate' : values.stopDate });
    },
       
    getState : function() {            
        //   return Ext.state.Manager.get(this.id + '_form'); 
        return Ext.state.Manager.get('timeinterval'); 
    }
		
});