SMART datagrid v.1 > Classes > GridBase
DataLudi.GridBase.setRowHeight method
指定通过row而指定的数据行的高度。
当同时变更多个行的高度时,可以使用setRowHeights。
只有在没有包含具有两个以上子列的layout的列组,并且DisplayOptions.variableRowHeight被指定为true时, 才会将所变更的值反映在画面上。 另外,如果将DisplayOptions.rowResizable或fixedRowResizable指定为true, 用户就可以通过用鼠标拖动RowIndicator区域的行下边框,变更个别行高。
function setRowHeight (row: Integer|GridRow, newHeight: Integer, noRedraw: Boolean): this;
- Returns
- this
- Parameters
- row - Integer|GridRow. required.
- newHeight - Integer. required.
行高。如果指定如
undefined等非数字的值,就会恢复为网格的
默认行高。
- noRedraw - Boolean. 默认值为false.
如果为
true,就会在变更之后,不会立即重新绘制。
在变更多行的高度之后,可以使用为直接调用
refreshView的方式。
Code -1
var row = grdMain.focusedRow();
if (row) {
var h = $('#edtRowHeight').val();
grid.setRowHeight(row, Math.max(4, Math.min(500, h)));
}
- See Also
- setRowHeights
- getRowHeight
- fitRowHeight
- clearRowHeights
- DisplayOptions.variableRowHeight
- DisplayOptions.rowResizable
- DisplayOptions.fixedRowResizable
- Examples
- 行高