-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathApp.js
More file actions
71 lines (66 loc) · 1.9 KB
/
Copy pathApp.js
File metadata and controls
71 lines (66 loc) · 1.9 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
61
62
63
64
65
66
67
68
69
70
71
/**
* This example introduces the concept of configuring and
* adding components to an app and connecting them with events.
*/
Ext.define('Rally.gettingstarted.UsingComponents', {
extend: 'Rally.app.App',
/**
* The app execution entry point
*/
launch: function() {
//Add a combobox displaying the available
//defect priorities. Wire up event listeners for
//when the combobox is initially loaded and when
//its value changes
this.add({
xtype: 'rallyfieldvaluecombobox',
itemId: 'priorityComboBox',
fieldLabel: 'Filter by Priority:',
model: 'Defect',
field: 'Priority',
context: this.getContext().getDataContext(),
listeners: {
ready: this._onLoad,
select: this._onSelect,
scope: this
}
});
},
/**
* Once the priority combobox has been loaded
* add a grid of defects for the selected priority
*/
_onLoad: function() {
this.add({
xtype: 'rallygrid',
columnCfgs: [
'FormattedID',
'Name',
'Priority',
'State',
'Severity'
],
context: this.getContext(),
storeConfig: {
model: 'Defect',
filters: [this._getPriorityFilter()]
}
});
},
/**
* Refresh the grid when the combobox changes value
*/
_onSelect: function() {
var grid = this.down('rallygrid'),
store = grid.getStore();
store.clearFilter(true);
store.filter(this._getPriorityFilter());
},
_getPriorityFilter: function() {
return {
property: 'Priority',
operator: '=',
value: this.down('#priorityComboBox').getValue()
};
}
});