SMART datagrid v.1 > Examples

[ grids ver.1.3.0]   Back  Forward

Row Heights  Example

If there is no column group of vertical layout which has two or more child columns contained in it, you can specify DisplayOptions.variableRowHeight as true to set the height of each data row be different individually. If specify DisplayOptions.rowResizable or fixedRowResizable as true, the user can drag the bottom border of the row in RowIndicator area to change the row height. In the script, GridBase.setRowHeight can be called to specify the row height. 

In addition, if double click the border or directly call GridBase.fitRowHeight in the script, the row height will be automatically optimized. 

Grid - 1

(The data in the example is based on the List of Nobel Prize for Literature in Wikipedia.) 


  Change the height of the focused row. 

Fit the height of the focused row to the contents. 

Initialize the height of the focused row. 

Initialize the height of all rows. 

Code -1
    var row = grdMain.focusedRow();
    if (row) {
        var h = $('#edtRowHeight').val();
        grdMain.setRowHeight(row, Math.max(4, Math.min(500, h)));
    }
Code -2
    var row = grdMain.focusedRow();
    if (row) {
        grdMain.fitRowHeight(row);
    }

View Source JSP 

See Also
DisplayOptions.variableRowHeight
DisplayOptions.rowResizable
fixedRowResizable
GridBase.getRowHeight
GridBase.setRowHeight
GridBase.setRowHeights
GridBase.fitRowHeight
GridBase.clearRowHeights
ColumnGroup.layout
RowIndicator
Examples
Fixed Rows