|
Using Column Model |
|
The Column model stores the set of the column objects.
Here is the example of how to set/get the column model object of myTable object:
myTable.setTableColumnModel(myColumnModel);
ColumnModel myColumnModel = myTable.TableColumnModel();
Column object describes behavior and appearance of all cells in the column. You can set class of the cells in the column for additional flexibility.
Here is example how to set the class of the cells for first column in the column model:
Column column = (Column) table.getTableColumnModel().findColumn(0);
column.setColumnClass("java.lang.Integer");
Click here to see TableColumnModelBean example
Click here to see using of tags to set Column Model example
<table:column> tag properties :
| • | individual properties |
Name |
Description |
id |
Defines table column ID. |
modelIndex |
Defines table column index in order to bind this column and the table data model. |
columnClass |
Defines table column class to set correspondence between the column and cell renderer, data comparator, data changer. See column classes predefinition. |
| • | look and feel properties |
Name |
Description |
align |
Horizontal alignment. All valid HTML values are permissible |
valign |
Vertical alignment. All valid HTML values are permissible |
width |
Width of a column in valid HTML term |
visible |
Set column visible/invisible. Default value - TRUE |
| • | appearance properties |
Name |
Description |
headerText |
Column header text, if this attribute is not set, header text is the same as the column's ID. |
hintText |
Column tool tip. Take precedence before Header hint tex |
maxLength |
Defines max count of characters for column editor that can be entered and translated into column object. Default value - 16 |
noWrapMode |
Wrap mode. Default value - TRUE |
sortSupported |
Enable/disable table sorting by the given column. Default value - TRUE |
highLightAllowed |
Enable/disable column rollover behavior. Default value - TRUE |