forked from stefankendall/AppTemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.js
More file actions
60 lines (55 loc) · 1.5 KB
/
App.js
File metadata and controls
60 lines (55 loc) · 1.5 KB
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
51
52
53
54
55
56
57
58
59
60
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
var states = Ext.create('Ext.data.Store', {
fields: ['name'],
data : [
{"name":"85"},
{"name":"100"},
{"name":"0"},
{"name":"ProjectManager"}
]
});
this.stateCombo = this.add({
xtype: 'combo',
store: states,
queryMode: 'local',
displayField: 'name',
valueField: 'name',
listeners: {
'select': this.onStateChange,
scope: this
}
});
},
onStateChange: function(combo, record) {
this.stateCombo.destroy();
this.capacityNotificationView = Ext.create('Ext.panel.Panel', {
bodyPadding: 20,
border: 0,
layout: 'hbox'
});
var state = record[0].get('name');
if(state == '85') {
Ext.create('CapacityUnderload', {
viewport: this
});
}
if(state == '100') {
Ext.create('CapacityOverload', {
viewport: this
});
}
if(state == '0') {
Ext.create('OK', {
viewport: this
});
}
if(state == 'ProjectManager') {
Ext.create('ProjectManager', {
viewport: this
});
}
}
});