Options
All
  • Public
  • Public/Protected
  • All
Menu

PrimeFaces TreeTable Widget

TreeTable is is used for displaying hierarchical data in tabular format.

Type parameters

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • Creates a new instance of this widget. Please note that you should NOT override this constructor. Instead, override the init method, which is called at the end of the constructor once the instance is created.

    Type parameters

    Parameters

    • cfg: PartialWidgetCfg<TCfg>

      The widget configuration to be used for this widget instance. This widget configuration is usually created on the server by the javax.faces.render.Renderer for this component.

    Returns TreeTable<TCfg>

Properties

Protected SORT_ORDER

SORT_ORDER: Record<SortOrder, 0 | 1 | -1>

Map between the sort order names and the multiplier for the comparator.

Optional ascMessage

ascMessage?: string

Localized message for sorting items in ascending order.

bodyTable

bodyTable: JQuery<HTMLElement>

The DOM element for the main TABLE element.

cfg

cfg: PartialWidgetCfg<TCfg>

The configuration of this widget instance. Please note that no property is guaranteed to be present, you should always check for undefined before accessing a property. This is partly because the value of a property is not transmitted from the server to the client when it equals the default.

clone

The DOM element for the clone of the table head.

columnWidthsFixed

columnWidthsFixed: boolean

Whether the width of all columns needs to stay fixed.

Optional contextMenuCell

contextMenuCell?: JQuery<HTMLElement>

DOM element of the table cell for which the context menu was opened, set by the data table.

currentCell

currentCell: JQuery<HTMLElement>

The DOM element for the currently selected cell, when using inline editing.

cursorNode

cursorNode: JQuery<HTMLElement>

The DOM element for the row at the cursor position, used for selecting multiple rows when holding the shift key.

Optional descMessage

descMessage?: string

Localized message for sorting items in descending order.

destroyListeners

Array of registered listeners invoked when this widget is destroyed. You should normally not use modify this directly, use addDestroyListener instead.

filterTimeout

filterTimeout: number

The set-timeout timer ID for the timer used for the delay during filtering.

footerCols

footerCols: JQuery<HTMLElement>

The DOM element for the TD columns in the table footer.

footerTable

footerTable: JQuery<HTMLElement>

The DOM element for the TABLE element of the footer.

headerCols

headerCols: JQuery<HTMLElement>

The DOM element for the TH columns in the header.

headerTable

headerTable: JQuery<HTMLElement>

The DOM element for the TABLE element of the header.

id

id: string | string[]

The client-side ID of this widget, with all parent naming containers, such as myForm:myWidget. This is also the ID of the container HTML element for this widget. In case the widget needs multiple container elements (such as Paginator), this may also be an array if IDs.

jq

The jQuery instance of the container element of this widget. In case id is an array, it will contain multiple elements. Please note that some widgets have got not DOM elements at all, in this case this will be an empty jQuery instance.

jqId

jqId: string

A CSS selector for the container element (or elements, in case id is an array) of this widget, This is usually an ID selector (that is properly escaped). You can select the container element or elements like this: $(widget.jqId).

jqSelection

jqSelection: JQuery<HTMLElement>

The DOM element for the hidden input storing the selected rows.

marginRight

marginRight: string

CSS unit for the right margin of this tree table, determined from the scrollbar width.

Optional otherMessage

otherMessage?: string

Localized message for displaying the rows unsorted.

paginator

The paginator widget instance used for filtering.

percentageScrollHeight

percentageScrollHeight: boolean

Whether the scroll height was specified in percent.

percentageScrollWidth

percentageScrollWidth: boolean

Whether the scroll width was specified in percent.

refreshListeners

Array of registered listeners invoked when this widget is refreshed. You should normally not use modify this directly, use addRefreshListener instead.

relativeHeight

relativeHeight: number

The height of the visible scroll area relative to the total height of this tree table.

Optional resizableState

resizableState?: string[]

Array storing the current widths for each resizable column.

Optional resizableStateHolder

resizableStateHolder?: JQuery<HTMLElement>

INPUT element storing the current widths for each resizable column.

resizeTimeout

resizeTimeout: number

The set-timeout timer ID of the timer used for resizing.

resizerHelper

resizerHelper: JQuery<HTMLElement>

The DOM element for the draggable handle for resizing columns.

scrollBody

scrollBody: JQuery<HTMLElement>

The DOM element for the scrollable DIV with the body table.

scrollFooter

scrollFooter: JQuery<HTMLElement>

The DOM element for the scrollable DIV with the footer table.

scrollFooterBox

scrollFooterBox: JQuery<HTMLElement>

The DOM element for the container DIV of the footer table.

scrollHeader

scrollHeader: JQuery<HTMLElement>

The DOM element for the scrollable DIV with the header table.

scrollHeaderBox

scrollHeaderBox: JQuery<HTMLElement>

The DOM element for the container DIV of the header table.

scrollStateHolder

scrollStateHolder: JQuery<HTMLElement>

The DOM element for the hidden input storing the current scroll position.

scrollStateVal

scrollStateVal: string

The value of the scrollStateHolder.

selections

selections: string[]

A list of row keys of the currently selected rows.

sortMeta

sortMeta: SortMeta[]

List of criteria by which to filter this table.

sortableColumns

sortableColumns: JQuery<HTMLElement>

The DOM elements for the list of sortable columns.

stickyContainer

stickyContainer: JQuery<HTMLElement>

The DOM element for the container with the sticky header.

tbody

The DOM element for the table body of this tree table.

thead

The DOM element for the table header of this tree table.

theadClone

theadClone: JQuery<HTMLElement>

The DOM element for the clone of the table header.

widgetVar

widgetVar: string

The name of the widget variables of this widget. The widget variable can be used to access a widget instance by calling PF('myWidgetVar').

Methods

Protected _render

  • _render(): void
  • This render method is called by this deferred widget once the widget container has become visible. You may now proceed with widget initialization.

    Must be overridden, or an error will be thrown.

    override

    Returns void

Protected addDeferredRender

  • addDeferredRender(widgetId: string, container: JQuery<HTMLElement>, callback: () => boolean): void
  • Adds a deferred rendering task for the given widget to the queue.

    Parameters

    • widgetId: string

      The ID of a deferred widget.

    • container: JQuery<HTMLElement>

      The container element that should be visible.

    • callback: () => boolean

      Callback that is invoked when the widget may possibly have become visible. Should return true when the widget was rendered, or false when the widget still needs to be rendered later.

        • (): boolean
        • Returns boolean

    Returns void

addDestroyListener

  • Lets you register a listener that is called before the component is destroyed.

    When an AJAX call is made and this component is updated, the DOM element is replaced with the newly rendered content. When the element is removed from the DOM by the update, the DOM element is detached from the DOM and all destroy listeners are called. This makes it possible to add listeners from outside the widget code.

    If you call this method twice with the same listener, it will be registered twice and later also called twice.

    Note that for this to work, you must not override the destroy method; or if you do, call super.

    Also, after this widget was detached is done, all destroy listeners will be unregistered.

    since

    7.0

    Parameters

    Returns void

addRefreshListener

  • When an AJAX call is made and this component is updated, the DOM element is replaced with the newly rendered content. However, no new instance of the widget is created. Instead, after the DOM element was replaced, all refresh listeners are called. This makes it possible to add listeners from outside the widget code.

    If you call this method twice with the same listener, it will be registered twice and later also called twice.

    Note that for this to work, you must not override the refresh method; or if you do, call super.

    Also, after the refresh is done, all refresh listeners will be deregistered. If you added the listeners from within this widget, consider adding the refresh listeners not only in the init method, but also again in the refresh method after calling super.

    since

    7.0.0

    Parameters

    Returns void

Private addSortMeta

  • Adds the given sorting to the list of sortings. Each sorting describes a column by which to sort. This data table may be sorted by multiple columns.

    Parameters

    Returns void

Private addToSelection

  • addToSelection(rowKey: string): void
  • Adds the given row to the list of currently selected rows.

    Parameters

    • rowKey: string

      A row that was selected.

    Returns void

Private adjustScrollHeight

  • adjustScrollHeight(): void
  • Adjust the view and scrolling position for the current height of the table.

    Returns void

Private adjustScrollWidth

  • adjustScrollWidth(): void
  • Adjust the view and scrolling position for the current width of the table.

    Returns void

Private alignScrollBody

  • alignScrollBody(): void
  • Aligns the scroll body element, taking into account the width of the scrollbar.

    Returns void

Private applyViewPortScrollHeight

  • applyViewPortScrollHeight(): void
  • Sets the height of the scroll body to the value of this widget's configuration.

    Returns void

Private bindChangeFilter

  • Sets up the event listeners required for filtering this tree table when the filter input has changed.

    Parameters

    Returns void

bindContextMenu

  • Callback that is invoked when the context menu is initialized. Lets the context menu provider register the appropriate event listeners for when the context menu should be shown and hidden.

    override

    Parameters

    • menuWidget: ContextMenu<ContextMenuCfg>

      The widget instance of the context menu.

    • targetWidget: TreeTable<TreeTableCfg>

      The widget instance of the target widget that wants to add a context menu.

    • targetId: string

      ID selector or DOM element of the target, i.e. the element the context menu belongs to.

    • cfg: ContextMenuCfg

      The current configuration of the context menu.

    Returns void

Private bindEditEvents

  • bindEditEvents(): void
  • Sets up all events listeners required for editing entire rows or individual cells.

    Returns void

Private bindEnterKeyFilter

  • Sets up the event listeners required for filtering this tree table when the enter key is pressed.

    Parameters

    Returns void

Private bindEvents

  • bindEvents(): void
  • Sets up all event listeners that are required by this widget.

    Returns void

Private bindFilterEvent

  • Sets up the event listeners required for filtering this tree table.

    Parameters

    Returns void

Private bindSelectionEvents

  • bindSelectionEvents(): void
  • Sets up all events listeners required for selecting one or multiple rows of this tree table.

    Returns void

Private bindSortEvents

  • bindSortEvents(): void
  • Sets up all events listeners required for sorting the rows of this tree table.

    Returns void

Private bindTextFilter

  • Sets up the event listeners required for filtering this tree table, filtering either when enter is pressed or when the configured event occurs.

    Parameters

    Returns void

callBehavior

  • Each widget may have one or several behaviors attached to it. This method calls all attached behaviors for the given event name. In case no such behavior exists, this method does nothing and returns immediately.

    A behavior is a way for associating client-side scripts with UI components that opens all sorts of possibilities, including client-side validation, DOM and style manipulation, keyboard handling, and more. When the behavior is triggered, the configured JavaScript gets executed.

    Behaviors are often, but not necessarily, AJAX behavior. When triggered, it initiates a request the server and processes the response once it is received. This enables several features such as updating or replacing elements dynamically. You can add an AJAX behavior via <p:ajax event="name" actionListener="#{...}" onstart="..." />.

    since

    7.0

    Parameters

    • event: string

      The name of an event to call.

    • Optional ext: Partial<ConfigurationExtender>

      Additional configuration that is passed to the AJAX request for the server-side callback.

    Returns void

cancelRowEdit

  • When a row is currently being edited: cancels row editing and discards the entered data.

    Parameters

    • rowEditor: JQuery<HTMLElement>

      A row for which to cancel editing, must be a TR element.

    Returns void

Private cellEditInit

  • When activating the inline editor of a cell, starts an AJAX request to fetch the editor's HTML. Also invokes the appropriate behaviors.

    Parameters

    Returns void

clearFilters

  • clearFilters(): void
  • Clear the filter input of this tree table and shows all rows again.

    Returns void

Private cloneHead

  • cloneHead(): void
  • Creates and stores a cloned copy of the table head(er), and sets up some event handlers.

    Returns void

Private cloneTableHeader

collapseNode

  • Collapses the given row of this tree table.

    Parameters

    Returns void

Private collapseRow

  • Collapses the given row of this tree table after saving the contents of an inline editor.

    Parameters

    Returns void

destroy

  • destroy(): void
  • Cleans up deferred render tasks. When you extend this class and override this method, make sure to call super.

    override

    Returns void

Private doCellEditCancelRequest

  • When the inline editor a cell is active and the user requests a cancel: discards the data and loads the original content of the cell.

    Parameters

    Returns void

Private doCellEditRequest

  • When the inline editor a cell is active and the user wants to save the changes: send the newly entered data to the server and hide the editor.

    Parameters

    Returns void

Private doRowEditRequest

  • Sends an AJAX request to the server to handle a row save or cancel event.

    Parameters

    • rowEditor: JQuery<HTMLElement>

      The inline editor with data that needs to be saved or discarded.

    • action: string

      The action to perform, either save or cancel.

    Returns void

expandNode

  • Expands the given row of this tree table.

    Parameters

    Returns void

filter

  • filter(): void
  • Reads the current value of the filter input and performs a filtering operation. Sends an AJAX requests to the server and updates this tree table with the result. Also invokes the appropriate behaviors.

    Returns void

Private findColWidthInResizableState

  • findColWidthInResizableState(id: string): null | string
  • Finds the saved width of the given column. The width of resizable columns may be saved to restore it after an AJAX update.

    Parameters

    • id: string

      ID of a column

    Returns null | string

    The saved width of the given column in pixels. null when the given column does not exist.

Private fireSelectEvent

  • fireSelectEvent(nodeKey: string, behaviorEvent: string): void
  • Sends a select event on server side to invoke a select listener if defined.

    Parameters

    • nodeKey: string

      The key of the node that was selected.

    • behaviorEvent: string

      Name of the event to fire.

    Returns void

Private fireSelectNodeEvent

  • fireSelectNodeEvent(nodeKey: string): void
  • Callback for when a node was selected. Invokes the appropriate behaviors.

    Parameters

    • nodeKey: string

      Key of the row that was selected.

    Returns void

Private fireUnselectNodeEvent

  • fireUnselectNodeEvent(nodeKey: string): void
  • Callback for when a node was unselected. Invokes the appropriate behaviors.

    Parameters

    • nodeKey: string

      Key of the row that was unselected.

    Returns void

Private fixColumnWidths

  • fixColumnWidths(): void
  • Applies the desired width to all columns.

    Returns void

getBehavior

  • getBehavior(name: string): null | Behavior
  • Each widget may have one or several behaviors attached to it. This method returns the callback function for the given event.

    Note: Do not call the method directly, the recommended way to invoke a behavior is via callBehavior.

    A behavior is a way for associating client-side scripts with UI components that opens all sorts of possibilities, including client-side validation, DOM and style manipulation, keyboard handling, and more. When the behavior is triggered, the configured JavaScript gets executed.

    Behaviors are often, but not necessarily, AJAX behavior. When triggered, it initiates a request the server and processes the response once it is received. This enables several features such as updating or replacing elements dynamically. You can add an AJAX behavior via <p:ajax event="name" actionListener="#{...}" onstart="..." />.

    Parameters

    • name: string

      The name of an event for which to retrieve the behavior.

    Returns null | Behavior

    The behavior with the given name, or null if no such behavior exists.

Private getCellMeta

  • Retrieves the meta data of the given cell.

    Parameters

    Returns string

    The meta data for the given cell.

getChildren

  • Finds the children of the given row.

    Parameters

    Returns JQuery<HTMLElement>

    The children of the given row. An empty jQuery instance in case the row does not have children.

getDescendants

  • Finds all descendants of the given row, i.e. all children, grandchildren etc.

    Parameters

    Returns JQuery<HTMLElement>

    The descendants of the given row. An empty jQuery instance in case the row does not have descendants.

getJQ

  • Each widget has got a container element, this method returns that container. This container element is usually also the element whose ID is the client-side ID of the JSF component.

    Returns JQuery<HTMLElement>

    The jQuery instance representing the main HTML container element of this widget.

getPaginator

  • Returns the paginator instance if any is exists.

    Returns undefined | Paginator<PaginatorCfg>

    The paginator instance for this widget, or undefined if paging is not enabled.

getParent

  • Finds the parent row of the given row of this tree table.

    Parameters

    Returns null | JQuery<HTMLElement>

    The parent of the given row, or null if it does not have a parent.

getParentForm

  • Gets the closest parent form for this widget.

    since

    10.0.0

    Returns JQuery<HTMLElement>

    A JQuery instance that either contains the form when found, or an empty JQuery instance when the form could not be found.

getParentFormId

  • getParentFormId(): undefined | string
  • Gets the closest parent form ID for this widget lazily so it can be used in AJAX requests.

    since

    10.0.0

    Returns undefined | string

    Either the form ID or undefined if no form can be found.

Private getRowEditors

Private getScrollbarWidth

  • getScrollbarWidth(): number
  • Attempts to find a width for the scrollbar of the browser.

    Returns number

    An estimate in pixels for the width of the native scrollbar.

Private getSortMessage

  • getSortMessage(ariaLabel: undefined | string, sortOrderMessage: string): string
  • Creates the sort order message shown to indicate what the current sort order is.

    Parameters

    • ariaLabel: undefined | string

      Optional label text from an aria attribute.

    • sortOrderMessage: string

      Sort order message.

    Returns string

    The sort order message to use.

Private handlePagination

  • Handles a pagination event by updating this tree table and invoking the appropriate behaviors.

    Parameters

    Returns void

hasBehavior

  • hasBehavior(event: string): boolean
  • Each widget may have one or several behaviors attached to it. This method checks whether this widget has got at least one behavior associated with given event name.

    A behavior is a way for associating client-side scripts with UI components that opens all sorts of possibilities, including client-side validation, DOM and style manipulation, keyboard handling, and more. When the behavior is triggered, the configured JavaScript gets executed.

    Behaviors are often, but not necessarily, AJAX behavior. When triggered, it initiates a request the server and processes the response once it is received. This enables several features such as updating or replacing elements dynamically. You can add an AJAX behavior via <p:ajax event="name" actionListener="#{...}" onstart="..." />.

    Parameters

    • event: string

      The name of an event to check.

    Returns boolean

    true if this widget has the given behavior, false otherwise.

Private hasVerticalOverflow

  • hasVerticalOverflow(): boolean
  • Checks if there is any vertical overflow present currently.

    Returns boolean

    true if there is overflow in the vertical y direction, or false otherwise.

Private indeterminateNodes

  • Sets the indeterminate attribute of the given rows to true.

    Parameters

    Returns void

init

  • A widget class should not declare an explicit constructor, the default constructor provided by this base widget should be used. Instead, override this initialize method which is called after the widget instance was constructed. You can use this method to perform any initialization that is required. For widgets that need to create custom HTML on the client-side this is also the place where you should call your render method.

    Please make sure to call the super method first before adding your own custom logic to the init method:

    PrimeFaces.widget.MyWidget = PrimeFaces.widget.BaseWidget.extend({
    init: function(cfg) {
    this._super(cfg);
    // custom initialization
    }
    });
    override

    Parameters

    • cfg: PartialWidgetCfg<TCfg>

      The widget configuration to be used for this widget instance. This widget configuration is usually created on the server by the javax.faces.render.Renderer for this component.

    Returns void

Private invalidateRow

  • invalidateRow(rowKey: string): void
  • Callback for when validation did not succeed. Switches all editors of the given row to the error state.

    Parameters

    • rowKey: string

      the rowKey.

    Returns void

isCheckboxSelection

  • isCheckboxSelection(): boolean
  • Checks whether rows of this tree table are selected via checkboxes.

    Returns boolean

    true if the TreeTableCfg.selectionMode is set to checkbox, or false otherwise.

isDetached

  • isDetached(): boolean
  • Checks if this widget is detached, ie whether the HTML element of this widget is currently contained within the DOM (the HTML body element). A widget may become detached during an AJAX update, and it may remain detached in case the update removed this component from the component tree.

    Returns boolean

    true if this widget is currently detached, or false otherwise.

isEmpty

  • isEmpty(): boolean
  • Checks whether any data is currently displayed.

    Returns boolean

    Whether there is any data displayed currently.

isMultipleSelection

  • isMultipleSelection(): boolean
  • Checks whether multiple rows of this tree table may be selected.

    Returns boolean

    true if the TreeTableCfg.selectionMode is set to multiple, or false otherwise.

isSelected

  • isSelected(nodeKey: string): boolean
  • Checks whether the given row is currently selected.

    Parameters

    • nodeKey: string

      Key of a row to check.

    Returns boolean

    Whether the given row is selected.

isSingleSelection

  • isSingleSelection(): boolean
  • Checks whether only a single row of this tree table can be selected via clicking.

    Returns boolean

    true if the TreeTableCfg.selectionMode is set to single, or false otherwise.

Private joinSortMetaOption

  • joinSortMetaOption(option: keyof SortMeta): string
  • Serializes the option from the sort meta items.

    Parameters

    • option: keyof SortMeta

      Property of the sort meta to use.

    Returns string

    All values from the current sort meta list for the given option.

Private onRowClick

  • Callback for when a row was clicked. Selects or unselects the row, if that feature is enabled.

    Parameters

    Returns void

Private onRowRightClick

  • Callback for when a right click was performed on a node. Selects or unselects the row, if that feature is enabled.

    Parameters

    Returns boolean

    true to hide the native browser context menu, false to display it

Protected postRender

  • postRender(): void
  • Called after the widget has become visible and after it was rendered. May be overridden, the default implementation is a no-op.

    Returns void

Private propagateUp

  • Propagates a select or unselect event up to the parents of the given row.

    Parameters

    Returns void

Private reclone

  • reclone(): void
  • Removes the cloned table header and create a new clone.

    Returns void

refresh

  • Used in ajax updates, reloads the widget configuration.

    When an AJAX call is made and this component is updated, the DOM element is replaced with the newly rendered content. However, no new instance of the widget is created. Instead, after the DOM element was replaced, this method is called with the new widget configuration from the server. This makes it possible to persist client-side state during an update, such as the currently selected tab.

    Please note that instead of overriding this method, you should consider adding a refresh listener instead via addRefreshListener. This has the advantage of letting you add multiple listeners, and makes it possible to add additional listeners from code outside this widget.

    By default, this method calls all refresh listeners, then reinitializes the widget by calling the init method.

    override

    Parameters

    Returns void

    The value as returned by the init method, which is often undefined.

Private removeDescendantsFromSelection

  • removeDescendantsFromSelection(rowKey: string): void
  • Removes all children of the given row from the list of currently selected rows.

    Parameters

    • rowKey: string

      A row with children that were unselected.

    Returns void

removeScriptElement

  • removeScriptElement(clientId: string | string[]): void
  • Removes the widget's script block from the DOM. Currently, the ID of this script block consists of the client-side ID of this widget with the prefix _s, but this is subject to change.

    Parameters

    • clientId: string | string[]

      The client-side ID of the widget.

    Returns void

removeSelection

  • removeSelection(nodeKey: string): void
  • Removes the given row from the list of currenlty selected rows.

    Parameters

    • nodeKey: string

      A row that was unselected.

    Returns void

render

  • This render method to check whether the widget container is visible. Do not override this method, or the deferred widget functionality may not work properly anymore.

    Returns ReturnOrVoid<undefined | boolean>

    true if the widget container is visible, false or undefined otherwise.

renderDeferred

  • renderDeferred(): void
  • Call this method in the init method if you want deferred rendering support. This method checks whether the container of this widget is visible and call _render only once it is.

    Returns void

Private resize

  • Callback for when a row was resized. Adjust the column widths.

    Parameters

    Returns void

Private restoreScrollState

  • restoreScrollState(): void
  • Reads the scroll position from the hidden input element and applies it.

    Returns void

saveCell

  • Saves the current data entered into a cell's inline editor. Checks whether the data has changed and if so, sends it to the server.

    Parameters

    Returns void

saveRowEdit

  • When a row is currently being edited: Saves the edited row and hides the editors.

    Parameters

    Returns void

Private saveScrollState

  • saveScrollState(): void
  • Stores the current scroll position in a hidden input element.

    Returns void

selectNode

  • Selects the given row. The TreeTableCfg.selectionMode must not be set to checkbox.

    Parameters

    • node: JQuery<HTMLElement>

      A row to select, must be a TR element.

    • Optional silent: boolean

      If set to true, does not trigger event listeners.

    Returns void

Private selectNodesInRange

  • Selects all rows between the current row and the row that was just clicked. Used for multiple selections while the shift key is pressed.

    Parameters

    Returns void

Private setColumnsWidth

  • Applies the appropriated width to all given column elements.

    Parameters

    Returns void

Private setOuterWidth

  • Applies the given outer width to an element.

    Parameters

    • element: JQuery<HTMLElement>

      An element to modify.

    • width: number

      The new (outer) width for the element.

    Returns void

Private setScrollWidth

  • setScrollWidth(width: number): void
  • Adjust the view for the given scrollbar width.

    Parameters

    • width: number

      The width of the scrollbar.

    Returns void

Private setupFiltering

  • setupFiltering(): void
  • Sets up all event listeners required for the standard filters. Also skins the filter inputs.

    Returns void

Private setupResizableColumns

  • setupResizableColumns(): void
  • Sets up the JQuery UI draggable with the appropriate event listeners for resizing columns.

    Returns void

Private setupScrolling

  • setupScrolling(): void
  • Initializes scrolling and sets up the appropriate event handlers.

    Returns void

Private setupStickyHeader

  • setupStickyHeader(): void
  • Sets up the CSS and event listeners for the sticky header feature, if it is enabled.

    Returns void

Private shouldSort

  • Checks whether the tree table should be sorted.

    Parameters

    Returns boolean

    Whether the tree table should be sorted.

showCellEditor

  • Activates the inline editor for the given cell.

    Parameters

    Returns void

Private showCurrentCell

  • Makes the inline cell visible and sets up the appropriate event listeners.

    Parameters

    • cell: JQuery<HTMLElement>

      The cell TD element for which to activate inline editing mode.

    Returns void

Private showRowEditors

  • Hides the row and display the row editors.

    Parameters

    Returns void

sort

  • Sort this tree table by the given column, either in ascending or descending order.

    Parameters

    • columnHeader: JQuery<HTMLElement>

      A column to sort by, must be a TH element of the THEAD.

    • order: SortOrder

      Whether to sort the rows in ascending or descending order.

    • multi: boolean

      true if sorting by multiple columns is enabled, or false otherwise.

    Returns void

switchToRowEdit

  • Switches a row to edit mode and displays the editors for that row.

    Parameters

    • row: JQuery<HTMLElement>

      A row for which to activate the editors. Must be a TR element.

    Returns void

Private tabCell

  • Callback for when the tab key is pressed, switches (focuses) to the next or previous cell editor.

    Parameters

    • cell: JQuery<HTMLElement>

      The currently focused cell.

    • forward: boolean

      true to move to the next cell, or false to move to the previous cell.

    Returns void

toggleCheckboxNode

  • When the TreeTableCfg.selectionMode is set to checkbox: select the given row if is is currently unselected, or unselects it otherwise.

    Parameters

    Returns void

unselectAllNodes

  • unselectAllNodes(): void

unselectNode

  • Unselects the given row. The TreeTableCfg.selectionMode must not be set to checkbox.

    Parameters

    • node: JQuery<HTMLElement>

      A row to unselect, must be a TR element.

    • Optional silent: boolean

      If set to true, does not trigger event listeners.

    Returns void

Private updateResizableState

  • Computes and saves the resizable state of this data table, ie. which columns have got which width. May be used later to restore the current column width after an AJAX update.

    Parameters

    • columnHeader: JQuery<HTMLElement>

      Element of a column header of this data table.

    • nextColumnHeader: JQuery<HTMLElement>

      Element of the column header next to the given column header.

    • table: JQuery<HTMLElement>

      The element for this data table.

    • newWidth: number

      New width to be applied.

    • nextColumnWidth: null | number

      Width of the column next to the given column header.

    Returns void

Private updateRows

Private updateSortPriorityIndicators

  • updateSortPriorityIndicators(): void
  • In multi-sort mode this will add number indicators to let the user know the current sort order. If only one column is sorted then no indicator is displayed and will only be displayed once more than one column is sorted.

    Returns void

Private updateVerticalScroll

  • updateVerticalScroll(): void
  • Updates the vertical scroll position and adjusts the margin.

    Returns void

Private viewMode

  • Switch from edit mode to view mode, Hides the inline editor and displays the data.

    Parameters

    Returns void

Private writeSelections

  • writeSelections(): void
  • Saves the currently selected rows in the hidden input field.

    Returns void

Generated using TypeDoc