Reference Source
public class | source

TreeList

Represents a ui TreeList

See:

Constructor Summary

Public Constructor
public

constructor(id: String, options: Object)

Constructor

Method Summary

Public Methods
public

clearSelection(): Null

Clears the currently selected table rows or cells

public

collapse(row: Object): Null

This method collapses the row passed as a parameter

public

Returns the data item to which the specified table row is bound.

public

expand(row: Object): Null

This method expands the row.

public

Obtains an Array of the DOM elements, which correspond to the data items.

public

select(rows: Object): Object

Gets or sets the table rows (or cells) which are selected.

public

setDataSource(dataSource: Array): Null

Sets the data source of the widget.

Public Constructors

public constructor(id: String, options: Object) source

Constructor

Params:

NameTypeAttributeDescription
id String

treelist id

options Object

config params

options.dataSource Array

the data source of the widget which is used to render table rows. A JavaScript array.

options.columns Array

the configuration of the treelist columns. An array of JavaScript objects.

options.columns.field String

the field to which the column is bound. The value of this field is displayed by the column during data binding.

options.columns.title String

the text that is displayed in the column header cell. If not set the field is used.

options.columns.attributes Object

HTML attributes of the table cell (<td>) rendered for the column.

options.columns.headerAttributes Object

HTML attributes of the table header cell (<th>) rendered for the column.

options.columns.width Number

the width of the column. Numeric values are treated as pixels.

options.columns.expandable Boolean

if set to true the column will show the icons that are used for expanding and collapsing child rows.(default: false)

options.resizable Boolean

if set to true allows usersto resize columns by dragging their header borders. By default resizing is disabled.

options.height Number

the height of the treelist. Numeric values are treated as pixels.

options.scrollable Boolean

if set to true the TreeList will display a scrollbar when the total row height (or width) exceeds the TreeList height (or width). By default scrolling is enabled.

options.selectable Boolean | String

if set to true the user would be able to select treelist rows. By default selection is disabled.
Can also be set to the following string values:

  • "row" - the user can select a single row.
  • "cell" - the user can select a single cell.
  • "multiple, row" - the user can select multiple rows.
  • "multiple, cell" - the user can select multiple cells.

options.change function(e: Object): null

fired when the user selects a table row or cell in the treelist.

Public Methods

public clearSelection(): Null source

Clears the currently selected table rows or cells

Return:

Null

public collapse(row: Object): Null source

This method collapses the row passed as a parameter

Params:

NameTypeAttributeDescription
row Object

A string, DOM element or jQuery object which represents the table row. A string is treated as a jQuery selector.

Return:

Null

public dataItem(row: Object): Object source

Returns the data item to which the specified table row is bound.

Params:

NameTypeAttributeDescription
row Object

A string, DOM element or jQuery object which represents the table row. A string is treated as a jQuery selector.

Return:

Object

public expand(row: Object): Null source

This method expands the row.

Params:

NameTypeAttributeDescription
row Object

A string, DOM element or jQuery object which represents the table row. A string is treated as a jQuery selector.

Return:

Null

public items(): Array source

Obtains an Array of the DOM elements, which correspond to the data items.

Return:

Array

The currently rendered data table rows (<tr> elements).

public select(rows: Object): Object source

Gets or sets the table rows (or cells) which are selected.

Params:

NameTypeAttributeDescription
rows Object

A string, DOM element or jQuery object which represents the table row(s) or cell(s). A string is treated as a jQuery selector.

Return:

Object

jQuery the selected table rows or cells.

public setDataSource(dataSource: Array): Null source

Sets the data source of the widget.

Params:

NameTypeAttributeDescription
dataSource Array

The data source to which the widget should be bound.

Return:

Null