vendredi 6 février 2015

Rally Custom App Checkbox filter not working

I am trying to create an custom app that allows me to search by Iteration(xtype: 'rallyiterationcombobox'), then use a checkbox(xtype: 'checkbox') to show only the "Blocked" items, and display this all on a grid.


I am having trouble with the checkbox. I can't get it to push a filter to only display "Blocked" items on the grid. I have done quite a bit of research, and what I have is the sum of that research(probably part of the problem), but alas, still no progress. Everything displays, but the checkbox does not funtion. Any suggestions?



<!DOCTYPE html>
<html>
<head>
<title>User Stories By Iteration</title>
<script type="text/javascript" src="/apps/2.0p4/sdk.js"></script>
<script type="text/javascript">
Rally.onReady(function() {
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',

//Containers for all items in the app
items: [
{
xtype: 'container',
itemId: 'dropdown'
},
{
xtype: 'container',
itemId: 'checkbox'
},
{
xtype: 'container',
itemId: 'grid'
}
],

launch: function() {
//Dropdown box for selecting an iteration
this.down('#dropdown').add({
xtype: 'rallyiterationcombobox',
margin: '10px 0px 0px 0px',
id: 'iterationComboBox',
listeners: {
ready: this._onLoad,
change: this._onChange,
scope: this
}
});

//Checkbox for toggling blocked items
this.down('#checkbox').add({
xtype: 'checkbox',
id: 'blockedFilter',
fieldLabel: 'Find Blocked Items in Iteration?',
padding: '5,5,5,5',
margin: '-31px 0px 0px 225px',
handler: this._onChecked
});
},

//Function that launches the grid
_onLoad: function(comboBox) {
Rally.data.ModelFactory.getModel({
type:'UserStory',
success:this._onModelRetrieved,
scope: this
});
},

//Updates grid when iteration dropdown is changed
_onChange: function() {
var filterConfig = {
property:'Iteration',
operator: '=',
value: this.down('#iterationComboBox').getValue()
};
this.grid.filter(filterConfig, true, true);
},

//BEGIN: POINT OF INTEREST
_getFilter: function() {
var filter = [];
if (Ext.getCmp('#blockedFilter').getValue()) this.grid.filter.push('Blocked');
return filter;
},

_onChecked: function() {
var changeBlock = this._getFilter();
var config = {
types: changeBlock
};
this.grid.refresh(config);
},
//END: POINT OF INTEREST

//Displays the main grid of information on the page
_onModelRetrieved: function(model) {
this.grid = this.down('#grid').add({
xtype:'rallygrid',
model: model,
id: 'iterationgrid',
pagingToolbarCfg:{
pageSizes: [25, 50, 100, 200]
},

columnCfgs:[
'FormattedID',
'Name',
'Iteration',
'Status',
'Blocked',
'Project'
],

storeConfig:{
context: this.context.getDataContext(),
filters:[
{
property:'Iteration',
operator: '=',
value: this.down('#iterationComboBox').getValue()
},
{
property: 'Blocked',
operator: '=',
value: this.down('#blockedFilter').getValue()
}
]
}
});
}
});

Rally.launchApp('CustomApp', {
name: 'User Stories By Iteration'
});
});
</script>
<style type="text/css">
</style>
</head>
<body></body>
</html>


Any information is helpful, as I am new to both Rally and Javascript. If there is a feature in Rally that does this already, I would like to know, but this app is actually for a feature I would like to implement with custom fields, I am just trying to get the architecture down first.





Aucun commentaire:

Enregistrer un commentaire