ColumnDef is a class to define column properties. It can set type of column and set hidden some column when using screen sizes of desktop, tablet or phone.
Description | ||
new ColumnDef() |
Create a new ColumnDef object. |
Description | ||
TYPE_AUTO_NUMBER |
Type of column is autoNumber. |
|
TYPE_CHECKBOX |
Type of column is checkbox. |
|
TYPE_DATE |
Type of column is date. |
|
TYPE_DOMNODE |
Type of column is domnode. |
|
TYPE_IMAGEBUTTON |
Type of column is imageButton. |
|
TYPE_MATH |
Type of column is math. |
|
TYPE_NUMBER |
Type of column is number. |
|
TYPE_RADIOBUTTON |
Type of column is radiobutton. |
|
TYPE_RESPONSIVE |
Type of column is responsive. |
|
TYPE_TEXT |
Type of column is text. |
|
TYPE_ZOOM |
Type of column is zoom. |
Type | Description | |
align | String |
Specifies the alignment of value. |
calculateType | String |
Type of calculate. If 'columnType' is TYPE_MATH must require calculateType. |
child | Object |
Contain HTML fragment for _TableBase class |
columnClass | String |
css classname for tag td. |
columns | ColumnDef[] |
Column that display in a table.(Array of columnDef.) |
columnsMerge | String |
Merge columns for text total of the table. |
columnType | String |
Type of column. (can use constant) |
dateFormat | String |
Format for data. If 'columnType' is TYPE_DATE must be require dateFormat. |
editOption | Object |
Open or close the edit. Object contains 3 values |
enabledCheckAll | Boolean |
If true, check all checkbox is shown in table header. |
fieldName | String |
Field name where data is stored. This may be from a JSON file or a stored procedure response. |
format | String |
Format for number. If 'columnType' is TYPE_NUMBER or TYPE_AUTO_NUMBER must be require format. |
header | String |
Text for header of the table. |
hiddenDesktop | Boolean |
If true, the column is hidden if desktop screen size is used. |
hiddenPhone | Boolean |
If true, the column is hidden if phone screen size is used. |
hiddenTablet | Boolean |
If true, the column is hidden if tablet screen size is used. |
image | Object |
If 'columnType' is TYPE_IMAGEBUTTON must be require image. This Object contains 2 values. |
lookupData | Dojo/store/Memory |
Property that store data of a column. |
lookupDisplayField | String |
Use in conjunction with lookupData property to control which singular field in the lookupData is selected from. |
sortable | Boolean |
If true, sort button is present for sorting table. |
textTotal | String |
Text for total of the table. |
valign | String |
Specifies the vertical alignment of value. |
width | String | Number |
Width of column. |
Return type | Description | |
_preparingColumn(columns) | None |
|
Create a new ColumnDef object.
Type of calculate. If 'columnType' is TYPE_MATH must require calculateType.
Default value: sum
Format for data. If 'columnType' is TYPE_DATE must be require dateFormat.
Default value: d MMMM yyyy
If true, check all checkbox is shown in table header.
Default value: false
Field name where data is stored. This may be from a JSON file or a stored procedure response.
Format for number. If 'columnType' is TYPE_NUMBER or TYPE_AUTO_NUMBER must be require format.
Default value: #,###.###
If 'columnType' is TYPE_IMAGEBUTTON must be require image. This Object contains 2 values.
Property that store data of a column.
var sampleData = [
{id:1, name:"Blue", codename:"Blu01"},
{id:2, name:"Red", codename:"Red01"}
];
var dataStore = new Memory({data: sampleData});
var colData = new ColumnDef({lookupData: dataStore});
Use in conjunction with lookupData property to control which singular field in the lookupData is selected from.
var colData = new ColumnDef({
lookupData: dataStore,
fieldName: "id",
lookupDisplayField: "codename",
});