Search code examples
rallyappsdk2

Rally SDK 2 manually filter or specify rallycardboard columns displayed


I am trying to create a simple rallycardboard app that displays projects as columns with the project backlog stories as cards. Then allow the drag/drop of cards to set the project. Code is attached.

If I specify 'Project" as the attribute, the board contains columns for all projects in the workspace. I wish to limit the columns shown to either

  1. Scoped parent and children, or
  2. Code a list of project columns. I have tried the manipulate the columns, columnConfig, context settings, but nothing produces the desired results.

    <!DOCTYPE html>
    <html>
    <head>
        <title>CardBoard Example</title>
    
        <script type="text/javascript" src="/apps/2.0rc2/sdk.js"></script>
    
        <script type="text/javascript">
            Rally.onReady(function() {
                Ext.define('ProjBoard', {
                    extend: 'Rally.app.App',
    
                    launch: function() {
                        if (cardBoardConfig) {
                            cardBoardConfig.destroy();
                        }
    
                        var cardBoardConfig = {
                            xtype: 'rallycardboard',
                            types: ['User Story'],
                            attribute: 'Project',
                            fieldToDisplay: 'Project',
                            cardConfig: {
                                fields: ['Project', 'Parent','Iteration']
                            },
                            storeConfig: {
                                filters: [
                                    { property: 'ScheduleState', operator: '<', value: 'In-Progress' },
                                    { property: 'Iteration', operator: '=', value: '' }
                                ],
                                sorters: [
                                    { property: 'Rank', direction: 'DESC' }
                                ],
                                //Specify current project and scoping
                                context: this.getContext().getDataContext()
                            }
                        };
    
                        this.add(cardBoardConfig);
                    }
                });
                Rally.launchApp('ProjBoard', {
                  name: 'Backlog Project Board'
                });
            });
        </script>
        <style type="text/css">
        </style>
    </head>
    <body></body>
    </html>
    

Solution

  • You should be able to specify the columns via config:

    https://help.rallydev.com/apps/2.0rc2/doc/#!/api/Rally.ui.cardboard.CardBoard-cfg-columns

    columns: [
        {
            value: '/project/12345',
            columnHeaderConfig: {
                headerTpl: '{project}',
                headerData: {project: 'Project 1'}
            }
        },
        //more columns...
    ]