Grid columns
Set of columns is defined by parameter COLUMNS, or HEADERS in compatibility mode with previous deprecated grid version. Grid column is an array including set of required and additional parameters.
Required parameters
Parameter | Type | Description |
---|---|---|
id | string / boolean | Column identifier. |
name | string | Column title, displayed to user. |
$column = [ 'id' => 'column_id', 'name' => 'Column title', ];
Additional parameters
Parameter | Type | Description |
---|---|---|
default | boolean | Defines if a default column must be displayed in grid by default. Columns are not displayed by default. |
sort | string | Field identifier used to perform sorting. |
first_order | string | First column sorting direction. Available values: 'asc' or 'desc'. |
showname | boolean | Allows hiding column title. Prints title by default. |
width | int | Column width in pixelspx. |
align | string | Text alignment in column cells. Possible values:
|
class | string | Custom CSS-class for column title. |
editable | array | Defines parameters for inline editing. If not defined, inline editing is disabled for column cells. Array editable must contain a required parameter TYPE, that accepts the constant as the value from \Bitrix\Main\Grid\Editor\Types. |
prevent_default | boolean | Cancels string highlighting when clicking on a column cells. Can be useful, when cell shows shows some interactive content. |
sticked | boolean | Pins column to the left, during horizontal scrolling. |
resizeable | boolean | Allows restricting column size changes. By default, changing column size is permitted. |
color | string | Column background color. CSS can be set as the value, or color in the formats hex, rgb or hsl. Also, grid has a standard set of colors \Bitrix\Main\Grid\Column\Color. |
© «Bitrix24», 2001-2024