Rally grid color rows based on model

北城余情 提交于 2019-12-02 07:56:27

Your approach above with the viewConfig should work- I am going to file a defect on this. The root cause is that the Rally.ui.grid.GridView is blowing away the getRowClass function in its constructor (for internal browser testing purposes- ugghh) rather than checking if there was one supplied and calling that as well.

You can see it the source for the constructor here: https://developer.help.rallydev.com/apps/2.0rc1/doc/source/GridView.html#Rally-ui-grid-GridView

You should be able to work around it by just re-overriding the function before the view is rendered.

[EDIT by asker] Added the following to the grid, and it worked:

listeners: {
    beforerender: function(cmp) {
        console.log('beforerender');
        console.log('view',cmp);
        cmp.view.getRowClass = function(record, index, rowParams, store) {
            console.log('record',record); // still nothing logged in console
            console.log('index',index);
            return 'colorCodeGrid'; // class never added
        };
    }
},

UPDATE:

I just fixed this in the nightly build, so this should no longer be an issue in public sdk builds beginning with the next public release after 2.0rc2.

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