隐藏纸板中的空行

时间:2015-10-28 17:10:30

标签: rally

是否可以在拉力卡中隐藏没有卡片的行?我没有看到任何行配置,我找不到一个简单的方法来遍历行并找到哪些是空的。

谢谢!

1 个答案:

答案 0 :(得分:0)

If you are basing your rows on a field with a constrained set of values (ScheduleState, a custom dropdown field, etc) the board will render a row for each value, whether there are cards or not. This sounds like what you're running into. It would probably be a nice addition to the component to be able to pass in a config to show empty rows or not.

In the meantime, you should be able to work around it by adding a load listener to the board, looping over the rows and then just collapsing them if they are empty.

this.add({
    xtype: 'rallycardboard',
    rowConfig: {
        //your rowConfig
    },
    listeners: {
        load: function(board) {
            var rows = board.getRows();
            _.each(rows, function(row) {
                var cardsInRow = board.getCardsInRow(row);
                var cardCount = _.flatten(_.values(cardsInRow)).length;
                if(cardCount === 0) {
                    row.collapse();
                }
            });
        }
    }
});