Tree Grid with Portfolio Items

228 views Asked by At

Is it possible to build a rallytreegrid xtype using portfolio item models through the TreeStoreBuilder? I am able to build a rallyportfolio tree with portfolio items, however have had trouble building a tree grid with this type of object.

2

There are 2 answers

0
Sean Hogan On

The following code does not render a Tree Grid or produce any error. The same code, with 'User Story' instead of 'portfolioitem/area' does work correctly:

launch: function() {
    Ext.create('Rally.data.wsapi.TreeStoreBuilder').build({
        models: ['portfolioitem/area'],
        autoLoad: true,
        enableHierarchy: true
    }).then({
        success: this._onStoreBuilt,
        scope: this
    });
},
_onStoreBuilt: function(store) {
    this.add({
        xtype: 'rallytreegrid',
        context: this.getContext(),
        store: store,
        columnCfgs: [
            'Name',
            'Owner',
            'Description'
        ]
    });
}
3
Kyle Morse On

After a bit of debugging I was able to get it to work by making a couple small tweaks to your code in the launch function:

launch: function() {
    Ext.create('Rally.data.wsapi.TreeStoreBuilder').build({
        models: ['portfolioitem/feature', 'userstory'],
        parentTypes: ['portfolioitem/feature'],
        autoLoad: true,
        fetch: ['Name', 'Owner', 'Description'],
        enableHierarchy: true
    }).then({
        success: this._onStoreBuilt,
        scope: this
    });
}

Again, this should work quite a bit smoother in the next sdk release but hopefully this should get you by for now.