Blame view

js/app/views/ResultUI.js 1.73 KB
16035364   Benjamin Renard   First commit
1
2
3
4
5
6
7
/**
 * Project   : AMDA-NG
 * Name      : ResultUI.js
 * @class 	 amdaUI.ResultUI
 * @extends  Ext. 
 * @brief	 Result  Module UI definition (View)
 * @author 	  
29c449bb   Elena.Budnik   format + redmine ...
8
 * @version  $Id: ResultUI.js 1052 2012-07-20 14:21:37Z elena $            
16035364   Benjamin Renard   First commit
9
10
11
 */

Ext.define('amdaUI.ResultUI', {
29c449bb   Elena.Budnik   format + redmine ...
12
13
	extend: 'Ext.container.Container',
	alias: 'widget.panelResult',
16035364   Benjamin Renard   First commit
14
	
29c449bb   Elena.Budnik   format + redmine ...
15
16
17
18
19
20
	requires: ['amdaUI.TabResultUI'],

	constructor: function(config) {
		this.init(config);
		this.callParent(arguments);	
	},
16035364   Benjamin Renard   First commit
21
    
29c449bb   Elena.Budnik   format + redmine ...
22
23
24
25
	getTabResult: function(nodeType) {
		var tabId = 'tab-'+nodeType;      
		return this.tabPanel.getComponent(tabId);
	},
16035364   Benjamin Renard   First commit
26
    
29c449bb   Elena.Budnik   format + redmine ...
27
	setObject: function(obj){},
16035364   Benjamin Renard   First commit
28
    
29c449bb   Elena.Budnik   format + redmine ...
29
30
31
	setResult: function(linkedNode){
		var configResult = {nodeType: linkedNode.get('jobType')}; 
		var panelResult = this.getTabResult(linkedNode.get('jobType'));
16035364   Benjamin Renard   First commit
32
	
29c449bb   Elena.Budnik   format + redmine ...
33
34
35
36
37
38
39
40
41
42
43
44
		if (!panelResult) {
			// create the plot Tab Result Panel	    
			panelResult = Ext.create('widget.tabResult',configResult);
			// add it
			this.tabPanel.add(panelResult);	  	      
		} 
		// focus on it
		this.tabPanel.setActiveTab(panelResult);
		var format = linkedNode.get('object').get('format');
		if (!format) format = 'unknown';	  
		var compression = linkedNode.get('object').get('compression');	     
		if (!compression) compression = 'unknown';	  
16035364   Benjamin Renard   First commit
45

29c449bb   Elena.Budnik   format + redmine ...
46
47
48
49
50
51
52
53
		panelResult.addResult(
			linkedNode.get('text'),
			linkedNode.get('object').get('resultId'),
			linkedNode.get('object').get('folderId'),
			compression.toLowerCase(),
			format.toLowerCase(),
			linkedNode.get('id'));
	},
16035364   Benjamin Renard   First commit
54
    
29c449bb   Elena.Budnik   format + redmine ...
55
56
57
58
59
60
61
62
63
64
65
66
	init : function(config)	{
		this.tabPanel = Ext.create('Ext.tab.Panel',{	   
			layout: { type :'vbox' },        
				activeTab: 0
		});
	
		var myConf = {
			layout: 'fit',   
			items: [ this.tabPanel ]
		};
		Ext.apply(this, Ext.apply(arguments, myConf));	    	    
	}    
16035364   Benjamin Renard   First commit
67
});