SMART datagrid v.1 > Examples

Back  Forward

ColumnLayouts  Example

ColumnLayout provides the way to relocate the columns set in the grid. You can pick a column contained in the column group to the top level, or gather the columns in another column group to organize a new column group. Of course, you can also display or hide the column which is not displayed currently. 

In addition, you can call GridBase.restoreColumns to return the original column layout. 

ColumnLayout is set through GridBase.columnLayout property. You can specify one of the predefined through columnLayouts, or specify a brand new ColumnLayout. 


Layouts:
Grid - 1
rows

Sort by column header. 

linearizeColumns release all column groups and place the rest of columns in a row. At this point, you can specify the column properties which are being used to sort. 

Code -1
    btnLinearize_click: function () {
        // Sort by column header text.
        grdMain.linearizeColumns(['header.text'], $('#chkReverse').is(':checked'));
    }
Note

You can keep the column layout which is displayed currently and use it again as ColumnLayout. 

   

Grid - 2
rows

View Source JSP 

See Also
GridBase.columnLayout
GridBase.restoreColumns
GridBase.linearizeColumns
GridBase.registerColumnLayouts
ColumnLayout
Examples