Columns
configurationThe configuration of the TreeList columns whcih represents an array of JavaScript objects or strings. JavaScript objects are interpreted as column configurations. Strings are interpreted as the
field to which the column is bound. The TreeList will create a column for each item of the array.
columns
Arraycolumns.attributes
ObjectThe HTML attributes of the table cell (<td>) that is rendered for the column.
Quote all HTML attributes which are JavaScript keywords (for example,
class).
columns.columns
ArrayThe columns which will be rendered as child columns under this group column header.
Group columns cannot be data-bound and support a limited number of bound column settings such as title or locked.
columns.command
ArrayThe configuration of the column commands. If set, the column will display a button for every command. Commands can be custom or built-in
The built-in commands are:
edit- Switches the current table row to edit mode. Supports theinlineandpopupedit modes.createChild- Adds a new child item to the current table row and switches to edit mode.destroy- Removes the data item to which the current table row is bound.
Custom commands are supported by specifying the click option.
- Each custom command requires you to explicitly specify its
name.- A command column cannot be
expandable.- The built-in commands work only if editing is enabled through the
editableoption and the DataSource of the TreeList is configured for CRUD operations.
columns.draggable
BooleanIf set to true a draghandle will be rendered and the user could reorder the rows by dragging the row via the drag handle.
Note that the reordering operation is only a client-side operation and it does not reflect the order of any data that is bound to the server.
Default: false
columns.editable
FunctionThe JavaScript function that is executed when the cell or row is about to be opened for editing. The returned result will determine whether an editor for the column will be created.
columns.editor
String|FunctionProvides a way to specify a custom editing UI for the column. To create the editing UI, use the container parameter.
- The editing UI has to contain an element with a set
nameHTML attribute. The attribute value has to match thefieldname.- The validation settings that are defined in the
model.fieldsconfiguration will not be applied automatically. In order for the validation to work, you (the developer) are responsible for attaching the corresponding validation attributes to the editor input. If the custom editor is a widget, to avoid visual issues, you can customize the tooltip position of the validation warning.
When used as String, defines the editor widget type. For further info check the Form API: field
The jQuery object that represents the container element.
The name of the field to which the column is bound.
The format string of the column that is specified through the format option.
The model instance to which the current table row is bound.
columns.editorOptions
ObjectDefines the widget configuration when one is initialized as editor for the column (or the widget defined in items.editor). For further info check the Form API: field.
columns.encoded
BooleanIf set to true, the column value will be HTML-encoded before it is displayed. If set to false, the column value will be displayed as is. By default, the column value is HTML-encoded.
Default: true
columns.expandable
BooleanIf set to true, the column will show the icons that are used for expanding and collapsing child rows. By default, the first column of the TreeList is expandable.
An expandable column cannot hold commands.
Default: false
columns.field
StringThe field to which the column is bound. The value of this field is displayed by the column during data binding.
The field name has to be a valid Javascript identifier, has to contain only alphanumeric characters,
$, or_, and must not start with a digit.
columns.filterable
Boolean|ObjectIf set to true and if filtering is enabled, a filter menu will be displayed for this column. If set to false, the filter menu will not be displayed. By default, a filter menu is displayed
for all columns when filtering is enabled through the filterable option. Can be set to a JavaScript object which represents the filter menu configuration.
Default: true
columns.footerTemplate
String|FunctionThe template which renders the footer table cell for the column.
The following fields can be used in the template:
average- The value of theaverageaggregate (if specified).count- The value of thecountaggregate (if specified).max- The value of themaxaggregate (if specified).min- The value of theminaggregate (if specified).sum- The value of thesumaggregate (if specified).
columns.format
StringThe format that is applied to the value before it is displayed. Takes the {0:format} form where format is a standard number format, custom number format, standard date format or a custom date format.
The
kendo.formatfunction is used to format the value.
columns.headerAttributes
ObjectThe HTML attributes of the table header cell (<th>) that is rendered for the column.
Quote the HTML attributes which are JavaScript keywords (for example,
class).
columns.headerTemplate
String|Functioncolumns.hidden
BooleanIf set to true, the TreeList will not display the column. By default, all columns are displayed.
Default: false
columns.includeChildren
BooleanIf set to true, the TreeList will select all child rows upon parent row selection when checkbox selection is used.
Default: false
columns.lockable
BooleanIf set to false, the column will remain in that side of the TreeList where its own locked configuration placed it.
This option is useful when the TreeList has columns which are configured with a
lockedvalue. Setting it explicitly tofalsewill
prevent the user from locking or unlocking this column while using the user interface.
Default: true
columns.locked
BooleanIf set to true, the TreeList will display the column as locked (frozen).
Default: false
columns.menu
BooleanIf set to true, the TreeList will display the column in the column menu. By default, the column menu includes all data-bound columns, that is, the ones with a set field option.
columns.minScreenWidth
NumberThe pixel screen width below which the column will be hidden. The setting takes precedence over the hidden setting and the two cannot not be used at the same time.
columns.selectable
BooleanIf set to true the treelist will render a select column with checkboxes in each cell, thus enabling multi-row selection. The header checkbox allows users to select/deselect all the rows on the current page.
Default: false
columns.sortable
Boolean|Objectcolumns.template
String|FunctionThe template which renders the column content. The TreeList renders table rows (<tr>) which represent the data source items.
Each table row consists of table cells (<td>) which represent the TreeList columns. By default, the HTML-encoded value of the field is displayed in the column.
To customize the way the column displays its value, use
template.
columns.title
StringThe text that is displayed in the column header cell. If not set, the TreeList uses field.
columns.width
String|NumberThe width of the column. Numeric values are treated as pixels.