@@ -7,6 +7,14 @@ Ext.define("custom-grid-with-deep-export", {
7
7
align : 'stretch'
8
8
} ,
9
9
items : [ {
10
+ id : Utils . AncestorPiAppFilter . RENDER_AREA_ID ,
11
+ xtype : 'container' ,
12
+ layout : {
13
+ type : 'hbox' ,
14
+ align : 'middle' ,
15
+ defaultMargins : '0 10 10 0' ,
16
+ }
17
+ } , {
10
18
id : 'grid-area' ,
11
19
xtype : 'container' ,
12
20
flex : 1 ,
@@ -40,22 +48,37 @@ Ext.define("custom-grid-with-deep-export", {
40
48
this . _buildStore ( ) ;
41
49
} ,
42
50
launch : function ( ) {
43
- Rally . data . util . PortfolioItemHelper . getPortfolioItemTypes ( )
44
- . then ( {
45
- success : function ( portfolioItemTypes ) {
46
- this . portfolioItemTypes = _ . sortBy ( portfolioItemTypes , function ( type ) {
47
- return type . get ( 'Ordinal' ) ;
48
- } ) ;
49
- this . _buildStore ( ) ;
50
- } ,
51
- failure : function ( msg ) {
52
- this . _showError ( msg ) ;
51
+ this . ancestorFilterPlugin = Ext . create ( 'Utils.AncestorPiAppFilter' , {
52
+ ptype : 'UtilsAncestorPiAppFilter' ,
53
+ pluginId : 'ancestorFilterPlugin' ,
54
+ settingsConfig : {
55
+ //labelWidth: 150,
56
+ //margin: 10
57
+ } ,
58
+ listeners : {
59
+ scope : this ,
60
+ ready : function ( plugin ) {
61
+ Rally . data . util . PortfolioItemHelper . getPortfolioItemTypes ( ) . then ( {
62
+ scope : this ,
63
+ success : function ( portfolioItemTypes ) {
64
+ this . portfolioItemTypes = _ . sortBy ( portfolioItemTypes , function ( type ) {
65
+ return type . get ( 'Ordinal' ) ;
66
+ } ) ;
67
+
68
+ plugin . addListener ( {
69
+ scope : this ,
70
+ select : this . viewChange
71
+ } ) ;
72
+ this . viewChange ( ) ;
73
+ } ,
74
+ failure : function ( msg ) {
75
+ this . _showError ( msg ) ;
76
+ } ,
77
+ } )
53
78
} ,
54
- scope : this
55
- } ) ;
56
- var listenerConfig = {
57
- scope : this
58
- }
79
+ }
80
+ } ) ;
81
+ this . addPlugin ( this . ancestorFilterPlugin ) ;
59
82
} ,
60
83
61
84
// Usual monkey business to size gridboards
@@ -93,11 +116,17 @@ Ext.define("custom-grid-with-deep-export", {
93
116
var gridArea = this . down ( '#grid-area' )
94
117
gridArea . removeAll ( ) ;
95
118
119
+ var currentModelName = this . modelNames [ 0 ] ;
120
+
96
121
var filters = this . getSetting ( 'query' ) ? [ Rally . data . wsapi . Filter . fromQueryString ( this . getSetting ( 'query' ) ) ] : [ ] ;
97
122
var timeboxScope = this . getContext ( ) . getTimeboxScope ( ) ;
98
123
if ( timeboxScope && timeboxScope . isApplicable ( store . model ) ) {
99
124
filters . push ( timeboxScope . getQueryFilter ( ) ) ;
100
125
}
126
+ var ancestorFilter = this . ancestorFilterPlugin . getFilterForType ( currentModelName ) ;
127
+ if ( ancestorFilter ) {
128
+ filters . push ( ancestorFilter ) ;
129
+ }
101
130
this . logger . log ( '_addGridboard' , store ) ;
102
131
103
132
var context = this . getContext ( ) ;
@@ -106,7 +135,6 @@ Ext.define("custom-grid-with-deep-export", {
106
135
dataContext . project = null ;
107
136
}
108
137
var summaryRowFeature = Ext . create ( 'Rally.ui.grid.feature.SummaryRow' ) ;
109
- var currentModelName = this . modelNames [ 0 ] ;
110
138
this . gridboard = gridArea . add ( {
111
139
xtype : 'rallygridboard' ,
112
140
context : context ,
0 commit comments