wizardbluebolt
wizardbluebolt

Reputation: 25

Custom app that changes app settings programatically needs to send some update event?

I am nearly done with a custom app that displays a grid of PortfolioItem/Features, and then displays a Kanban board for the User Stories that are associated with the selected feature from the grid. I am using the Kanban board from the app catalog as the basis for this custom app.

As the plug-ins for the Kanban board itself seem kind of complicated, my approach to filtering the stories is to set the query setting to (Feature.FormattedID = "F1234") programatically. I first had to add a name to the query setting in the example's Settings.js:

            {
                name: 'query',
                type: 'query'
            }

It only had the type property before.

I then hooked a function to my feature grid's selection event to set the 'query' setting to the desired string using the provided method at the app level:

...

    this.updateSettingsValues({
        settings: {
            query: qString
        },
        success: function() {
            console.log("Query setting changed");
        },
        scope: this
    });

When I select a feature in the grid, I get the log entry showing success, but the Kanban grid content does not change. If I open the settings UI after making a selection I see the expected query string in the 'query' setting text box. If I click the Save button without changing anything else, the Kanban then does correctly update as expected, showing only the desired User Stories.

I have checked the docs for the Settings, and the entry describing the updateSettingsValues() under the Bare Metal section doesn't mention any event to fire to cause the settings change to actually be applied in the app, and I am at a loss as to which event I want to do this. I think I am only one tantalizing line of code away from custom app glory...

Upvotes: 1

Views: 174

Answers (1)

Kyle Morse
Kyle Morse

Reputation: 8410

Sounds like a cool app! You will soon be immortalized in the annals of Rally app history. All you should need to do is trigger the refresh of the board. Check out the Rally.ui.cardboard.CardBoard.refresh method:

cardboard.refresh({
    storeConfig: {
        filters: [
            Rally.data.wsapi.Filter.fromQueryString(qString)
        ]
    }
});

Upvotes: 1

Related Questions