AnsweredAssumed Answered

custom grid filtered from milestone

Question asked by thomasguarino1365421 on Sep 1, 2015
Latest reply on Sep 16, 2015 by DavidAditutori1351530
Hi all,

I am trying to create an HTML app that stems from the example of FILTERABLE CUSTOM LIST.  This is close to what I need, but not quite, and I can't get it to work.

I am looking for this dropdown filter to use the MILESTONE dropdown.  And to show Everything tied to it, features, test cases, stories, defects, etc.

I changed some code in the _getStateFilter, and I am guessing maybe this isnt right, since its a one-many relationship??  Also, is there someway to simply get multiple models?  So i can show defects, stories. portfolio items and testcases?
 
<!DOCTYPE html>
<html>
<head>
    <title>Filtered Grid Example</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: 'stateComboBox',
                        fieldLabel: 'Filter by Milestone:',
                        model: 'userstory',
                        field: 'State',
                        listeners: {
                            select: this._onSelect,
                            ready: this._onLoad,
                            scope: this
                        }
                    });
                },
            
                _onLoad: function() {
                    this.add({
                        xtype: 'rallygrid',
                        columnCfgs: [
                            'FormattedID',
                            'Name',
                            'State',
                            'Priority',
                            'Severity'
                        ],
                        context: this.getContext(),
                        storeConfig: {
                            model: 'userstory',
                            filters: [this._getStateFilter()]
                        }
                    });
                },
            
                _getStateFilter: function() {
                    return {
                        property: 'Milestone',
                        operator: '=',
                        value: this.down('#stateComboBox').getValue()
                    };
                },
            
                _onSelect: function() {
                    var grid = this.down('rallygrid'),
                        store = grid.getStore();
            
                    store.clearFilter(true);
                    store.filter(this._getStateFilter());
                }
            });
            

            Rally.launchApp('Rally.example.FilteredGrid', {
              name: 'Filtered Grid Example'
            });
        });
    </script>

    <style type="text/css">
        
    </style>
</head>
<body></body>
</html>


Thanks for any help
 

Outcomes