I started with a Filtered Grid Example and added the ability to filter by Milestone from a dropdown - so that I can track both US's and Defects that are expected for an upcoming milestone. The app used to work perfectly and now seems to be stuck pulling the milestones to populate the dropdown.
<!DOCTYPE html><!DOCTYPE html>
<html>
<head>
<title>Milestone Filtered Items</title>
<script type="text/javascript" src="/apps/2.0/sdk.js"></script>
<script type="text/javascript">
Rally.onReady(function() {
Ext.define('Rally.example.FilteredGrid', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
this.add({
xtype: 'rallymilestonecombobox',
itemId: 'milestonesComboBox',
fieldLabel: 'Filter by Milestone:',
models: ['userstory','defect','portfolioItem/feature'],
field: 'Milestones',
listeners: {
select: this._onSelect,
ready: this._onLoad,
scope: this
}
});
},
_onLoad: function() {
this.add({
xtype: 'rallygrid',
columnCfgs: [
'Project',
'FormattedID',
'Name',
'ScheduleState',
'State',
'StoryType'
],
enableEditing: false,
showRowActionsColumn: false,
context: this.getContext(),
storeConfig: {
models: ['userstory','defect','portfolioItem/feature'],
sorters: [
{
property: 'Project',
direction: 'ASC'
},
{
property: 'FormattedID',
direction: 'DESC'
}
],
filters: [
{
property: 'Milestones',
operator: '=',
value: this.down('#milestonesComboBox').getValue()
},
{
property: 'ScheduleState',
operator: '!=',
value: 'Accepted'
}
]
}
});
},
_onSelect: function() {
var filter = null;
var grid = this.down('rallygrid'),
store = grid.getStore();
store.clearFilter(true);
var filter = Ext.create('Rally.data.QueryFilter', {
property: 'Milestones',
operator: '=',
value: this.down('#milestonesComboBox').getValue()
});
filter = filter.and({
property: 'ScheduleState',
operator: '!=',
value: 'Accepted'
});
store.filter([filter]);
}
});
Rally.launchApp('Rally.example.FilteredGrid', {
name: 'Filtered Grid Example'
});
});
</script>
<style type="text/css">
</style>
</head>
<body></body>
</html>
------------------------------
Benefitfocus.com, Inc
------------------------------