dGrid:如何在网格中添加空行?

时间:2021-10-11 02:27:14

I have created a jsfiddle over here.

我在这里创建了一个jsfiddle。

dGrid:如何在网格中添加空行? There is a row (no.4) in the the store having empty/null values, but the grid display appears to be collapsed.

商店中有一行(No.4)具有空/空值,但网格显示似乎已折叠。

code snippet:

function(Grid, Memory) {
    var data = [

        { id: 1, name: 'Peter', age:24 },
        { id: 2, name: 'Paul', age: 30 },
         { id: 3, name: 'Mary', age:46 },
        { id: '', name: '', age:'' }
    ];
    var store = new Memory({ data: data });
    var options = {
        columns: [
           /*{ field: 'id',  label: 'ID' },*/
            { field: 'name', label: 'Name' },
            { field: 'age', label: 'Age' }

        ],
        store: store
    };

    new Grid(options, 'gridcontainer');
}

I would like to have blank rows in the grid with the same height as other populated rows.

我想在网格中有空行,其高度与其他填充行相同。

Is it possible in dGrid?

在dGrid中有可能吗?

1 个解决方案

#1


I believe the reason why blank rows do not have the same height as other rows is that dGrid doesn't actually set a specific height that a row should have. In situations where a cell may need a 2nd row, then the cell would grow in height. If you want a set height, you can add a css attribute to your fiddle that does something like:

我相信空行与其他行的高度不同的原因是dGrid实际上并没有设置行应该具有的特定高度。在细胞可能需要第二行的情况下,细胞将在高度上增长。如果你想要一个设定的高度,你可以为你的小提琴添加一个css属性,它具有以下特点:

#gridcontainer .dgrid-content .dgrid-cell {
  height: 24px;
}

#1


I believe the reason why blank rows do not have the same height as other rows is that dGrid doesn't actually set a specific height that a row should have. In situations where a cell may need a 2nd row, then the cell would grow in height. If you want a set height, you can add a css attribute to your fiddle that does something like:

我相信空行与其他行的高度不同的原因是dGrid实际上并没有设置行应该具有的特定高度。在细胞可能需要第二行的情况下,细胞将在高度上增长。如果你想要一个设定的高度,你可以为你的小提琴添加一个css属性,它具有以下特点:

#gridcontainer .dgrid-content .dgrid-cell {
  height: 24px;
}