SDK2: Links in Rally Grids and column width

南笙酒味 提交于 2019-12-12 18:10:07

问题


I'm displaying a link to a defect in a Rally Grid in the simple way:

columnCfgs: ['FormattedID', 'Name', ...]

This creates a link to the defect, just like it should. But the column width is way too big. But if I do the following, I loose the link:

columnCfgs: [{dataIndex: 'FormattedID', width: 50, text:'ID'}', 'Name', ...]

Is there a convenient xtype I can use to adjust the width, but still have a link to my defect?


回答1:


Unfortunately there is not an easy way to do this right now. We are going to fix this before we GA the SDK 2.0. For now here is a workaround:

Ext.define('DefectGridApp', {
    extend: 'Rally.app.App',

    launch: function() {
        Rally.data.ModelFactory.getModel({
            type: 'Defect',
            success: function(model) {

                //Get the default field config
                var field = model.getField('FormattedID');
                var fieldConfig = Rally.ui.grid.FieldColumnFactory.getColumnConfigFromField(field);

                //Override with your values
                fieldConfig.width = 10;

                this.grid = this.add({
                    xtype: 'rallygrid',
                    model: model,
                    columnCfgs: [
                        fieldConfig,  //pass your overridden formatted id field here
                        'Name',
                        'Owner'
                     ]  
                 });
             },
             scope: this
         });
     }
});



回答2:


For a slightly differnt solution see: this question for how to add the link back to your original try.



来源:https://stackoverflow.com/questions/12517383/sdk2-links-in-rally-grids-and-column-width

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!