SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.fitColumnWidth  method

Adjust column width so that data cells being contained in the column can all be displayed. 

If double click the right side of column header cell during the run time, this method will be called. 

function fitColumnWidth (column: GridColumn, maxWidth: Number, minWidth: Number, visibleOnly: Boolean, includeHeader: Boolean);
Returns
Void
Parameters
column - GridColumn.
Column object which will adjust the width. If do not specify or it is null, undefined, it will adjust the width of all columns.
maxWidth - Number.
The maximum width. Only if specify a value greater than 0, it will be meaningful.
minWidth - Number.
The minimum width. Only if specify a value greater than 0, it will be meaningful.
visibleOnly - Boolean. Defaults to false.
If it is true, it will only calculate rows which are displayed on the screen now.
includeHeader - Boolean. Defaults to false.
If it is true, it will reflect the width of column header. (ver1.3.3)
Code -1
    $('#fitWidth').click(function (e) {
        var col = grid.focusedColumn();
        if (col) {
            grid.fitColumnWidth(col);
        }
    });
See Also
GridColumn.width
Examples
Column Header