configures columns of the table
webix.ui({
view:"datatable",
...
columns:[
{ id:"rank", header:{ text:"#", rowspan:2}, width:50, css:"rank"},
{ id:"title", header:["Film title", {text:"Second line", colspan:3}]},
{ id:"year", header:["Year",""], width:80},
{ id:"votes", header:["Votes",""], width:100}
]
});
Each object in the array specifies a single column. An object can take the following attributes:
adjust | (boolean) adjusts the width of the column to fit the related content size |
css | (string) the name of a css class that will be applied to the column |
cssFormat | (function) sets a function that takes a data property value as a parameter and returns object with css properties ( or the name of a css class) that will be applied to a cell
with the related value. The parameters are as follows: |
editor |
(string) the type of the column editors. The attribute can take only one of a predefined set of values. The predefined values are:
|
editAction |
(string) the type of an action that would open datatable cell for editing. The predefined values are:
|
liveEdit | (bool) sets on-the-go updating for the same data property used in different columns and edited in one of them |
fillspace | (boolean, number) forces the column to widen for filling the unused table space. In case of numeric values other than 1 the columns will distribute the available space proportionally according to the numbers. |
format | (function) the data format |
footer |
(string, array) specifies the footer of the column. As an array, the footer can contain both string and object values.
Object values can have the following attributes:
|
header |
(string, array) specifies the header of the column. As an array, the header can contain both string and object values.
Object values can have the following attributes:
|
id | (string) the id of the column |
math | (string) the math formula that applies to all cells of the column |
sort |
(string, function) enables sorting for the column (triggered by a single click on the header) and assigns one of predefined sorting types or the name of a sorting function.
As a string the attribute can take only one of a predefined set of values. The predefined values are:
|
template | (string, function) the data template |
width | (number) the width of the column |