getColumn()
returns an object with attributes of a column
getColumn(colId: Id): ICol;
Parameters:
colId: string | number
- the id of a column
Returns:
An object with attributes of a column.
Example
const column = treegrid.getColumn("b"); // ->
// {width: 100, id: "b", header: Array(1), $cellCss: {…}, type: "string"}
The returned object contains the following set of properties:
id | (string|number) the id of a column |
width | (number) the width of a column |
header | (array) an array of objects with header rows configuration |
htmlEnable | (boolean) if set to true, specifies the HTML content (inner HTML) of a column. If set to false, the content of the column cells will be displayed as a string value |
footer | (array) an array of objects with footer rows configuration |
maxWidth | (number) the maximal width to be set for a column |
minWidth | (number) the minimal width to be set for a column |
mark | (object|function) returns a template for marking a cell(s) |
resizable | (boolean) defines whether a column can be resized |
type | (string) the type of a column: "string"|"number"|"boolean"|"percent"|"date" |
format | (string) defines the format for the content of the column's cells |
editorType | (string) the type of an editor used in a column: "input"|"select"|"combobox"|"textarea"|"multiselect" |
options | (array) a set of options to be displayed in the editor of a cell (editorType: "select"|"combobox"|"multiselect") |
template | (function) returns a template with content for a cell(s) |
hidden | (boolean) defines whether a column is hidden |
draggable | (boolean) defines whether a column is draggable |
editable | (boolean) defines whether a column is editable |
sortable | (boolean) defines whether a column is sortable |
adjust | (boolean|string) defines whether the width of a column is automatically adjusted to its content |
autoWidth | (boolean) enables/disables the ability of a column to adjust its size to the size of TreeGrid |
align | (string) aligns data in a column: "left" | "center" | "right" |
tooltip | (boolean) enables a tooltip on hovering over the content of a column, true by default |
tooltipTemplate | (function) returns a template for the content of the tooltip |
$cellCss | (array) readonly, an array of objects with CSS classes (as key:value pairs) for each cell of a column |
$uniqueData | (array) readonly, an array that contains some unique data, can't be redefined |