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

  • 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

SORT_ORDER: Record<PrimeFaces.widget.DataTable.SortOrder, 0 | 1 | -1>

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

ascMessage?: string

Localized message for sorting items in ascending order.

bodyTable: JQuery<HTMLElement>

The DOM element for the main TABLE element.

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: JQuery<HTMLElement>

The DOM element for the clone of the table head.

columnWidthsFixed: boolean

Whether the width of all columns needs to stay fixed.

contextMenuCell?: JQuery<HTMLElement>

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

currentCell: JQuery<HTMLElement>

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

cursorNode: JQuery<HTMLElement>

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

descMessage?: string

Localized message for sorting items in descending order.

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

filterTimeout: number

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

footerCols: JQuery<HTMLElement>

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

footerTable: JQuery<HTMLElement>

The DOM element for the TABLE element of the footer.

headerCols: JQuery<HTMLElement>

The DOM element for the TH columns in the header.

headerTable: JQuery<HTMLElement>

The DOM element for the TABLE element of the header.

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: JQuery<HTMLElement>

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: 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: JQuery<HTMLElement>

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

marginRight: string

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

otherMessage?: string

Localized message for displaying the rows unsorted.

The paginator widget instance used for filtering.

percentageScrollHeight: boolean

Whether the scroll height was specified in percent.

percentageScrollWidth: boolean

Whether the scroll width was specified in percent.

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

relativeHeight: number

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

resizableState?: string[]

Array storing the current widths for each resizable column.

resizableStateHolder?: JQuery<HTMLElement>

INPUT element storing the current widths for each resizable column.

resizeTimeout: number

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

resizerHelper: JQuery<HTMLElement>

The DOM element for the draggable handle for resizing columns.

scrollBody: JQuery<HTMLElement>

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

scrollFooter: JQuery<HTMLElement>

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

scrollFooterBox: JQuery<HTMLElement>

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

scrollHeader: JQuery<HTMLElement>

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

scrollHeaderBox: JQuery<HTMLElement>

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

scrollStateHolder: JQuery<HTMLElement>

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

scrollStateVal: string

The value of the scrollStateHolder.

selections: string[]

A list of row keys of the currently selected rows.

sortMeta: SortMeta[]

List of criteria by which to filter this table.

sortableColumns: JQuery<HTMLElement>

The DOM elements for the list of sortable columns.

stickyContainer: JQuery<HTMLElement>

The DOM element for the container with the sticky header.

tbody: JQuery<HTMLElement>

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

thead: JQuery<HTMLElement>

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

theadClone: JQuery<HTMLElement>

The DOM element for the clone of the table header.

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

  • _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

  • 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

  • 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

  • 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

  • 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

  • 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

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

  • bindChangeFilter(filter: JQuery<HTMLElement>): void
  • Sets up the event listeners required for filtering this tree table when the filter input has changed.

    Parameters

    • filter: JQuery<HTMLElement>

      The filter input field.

    Returns void

  • bindClearFilterEvent(filter: JQuery<HTMLElement>): void
  • Sets up the 'search' event which for HTML5 text search fields handles the clear 'x' button.

    Parameters

    • filter: JQuery<HTMLElement>

      INPUT element of the text filter.

    Returns void

  • 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

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

    Returns void

  • bindEnterKeyFilter(filter: JQuery<HTMLElement>): void
  • Sets up the event listeners required for filtering this tree table when the enter key is pressed.

    Parameters

    • filter: JQuery<HTMLElement>

      The filter input field.

    Returns void

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

    Returns void

  • bindFilterEvent(filter: JQuery<HTMLElement>): void
  • Sets up the event listeners required for filtering this tree table.

    Parameters

    • filter: JQuery<HTMLElement>

      The filter input field.

    Returns void

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

    Returns void

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

    Returns void

  • bindTextFilter(filter: JQuery<HTMLElement>): void
  • Sets up the event listeners required for filtering this tree table, filtering either when enter is pressed or when the configured event occurs.

    Parameters

    • filter: JQuery<HTMLElement>

      The filter input field.

    Returns void

  • 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(rowEditor: JQuery<HTMLElement>): void
  • 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

  • cellEditInit(cell: JQuery<HTMLElement>): void
  • When activating the inline editor of a cell, starts an AJAX request to fetch the editor's HTML. Also invokes the appropriate behaviors.

    Parameters

    • cell: JQuery<HTMLElement>

      The cell for which inline editing should be activated.

    Returns void

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

    Returns void

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

    Returns void

  • cloneTableHeader(thead: JQuery<HTMLElement>, table: JQuery<HTMLElement>): JQuery<HTMLElement>
  • Clones a table header and removes duplicate IDs.

    Parameters

    • thead: JQuery<HTMLElement>

      The head (THEAD) of the table to clone.

    • table: JQuery<HTMLElement>

      The table to which the head belongs.

    Returns JQuery<HTMLElement>

    The cloned table head.

  • collapseNode(node: JQuery<HTMLElement>): void
  • Collapses the given row of this tree table.

    Parameters

    • node: JQuery<HTMLElement>

      A node to collapse, must be a TR element.

    Returns void

  • collapseRow(row: JQuery<HTMLElement>): void
  • Collapses the given row of this tree table after saving the contents of an inline editor.

    Parameters

    • row: JQuery<HTMLElement>

      A row to collapse.

    Returns void

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

    override

    Returns void

  • doCellEditCancelRequest(cell: JQuery<HTMLElement>): void
  • 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

    • cell: JQuery<HTMLElement>

      The cell for which editing should be canceled.

    Returns void

  • doCellEditRequest(cell: JQuery<HTMLElement>): void
  • 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

    • cell: JQuery<HTMLElement>

      The cell with an inline editor to be saved.

    Returns void

  • doRowEditRequest(rowEditor: JQuery<HTMLElement>, action: string): void
  • 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(node: JQuery<HTMLElement>): void
  • Expands the given row of this tree table.

    Parameters

    • node: JQuery<HTMLElement>

      A node to expand, must be a TR element.

    Returns void

  • 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

  • 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.

  • fireSelectEvent(nodeKey: string, behaviorEvent: string, fnShowMenu?: (() => void)): 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.

    • Optional fnShowMenu: (() => void)

      Optional callback function invoked when the menu was opened.

        • (): void
        • Returns void

    Returns void

  • 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

  • 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

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

    Returns void

  • 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.

  • getCellMeta(cell: JQuery<HTMLElement>): string
  • Retrieves the meta data of the given cell.

    Parameters

    • cell: JQuery<HTMLElement>

      A cell to inspect.

    Returns string

    The meta data for the given cell.

  • Finds the children of the given row.

    Parameters

    • node: JQuery<HTMLElement>

      A row for which to find the children.

    Returns JQuery<HTMLElement>

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

  • getDescendants(node: JQuery<HTMLElement>): JQuery<HTMLElement>
  • Finds all descendants of the given row, i.e. all children, grandchildren etc.

    Parameters

    • node: JQuery<HTMLElement>

      A node for which to get the descendants.

    Returns JQuery<HTMLElement>

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

  • 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.

  • 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(node: JQuery<HTMLElement>): null | JQuery<HTMLElement>
  • Finds the parent row of the given row of this tree table.

    Parameters

    • node: JQuery<HTMLElement>

      A row for which to find the parent.

    Returns null | JQuery<HTMLElement>

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

  • getParentForm(): JQuery<HTMLElement>
  • 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(): 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.

  • getRowEditors(row: JQuery<HTMLElement>): JQuery<HTMLElement>
  • Finds all editors of a row.

    Parameters

    • row: JQuery<HTMLElement>

      A row for which to find all cell editors.

    Returns JQuery<HTMLElement>

    All cell editors of the given row.

  • 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.

  • 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.

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

    Parameters

    Returns void

  • 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.

  • 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.

  • indeterminateNodes(nodes: JQuery<HTMLElement>): void
  • Sets the indeterminate attribute of the given rows to true.

    Parameters

    • nodes: JQuery<HTMLElement>

      List of rows to process.

    Returns void

  • 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

  • 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(): 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(): 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(): boolean
  • Checks whether any data is currently displayed.

    Returns boolean

    Whether there is any data displayed currently.

  • 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(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(): 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.

  • 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.

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

    Parameters

    • event: TriggeredEvent<any, any, any, any>

      The click event that occurred.

    • node: JQuery<HTMLElement>

      The node that was clicked.

    Returns void

  • onRowRightClick(event: TriggeredEvent<any, any, any, any>, node: JQuery<HTMLElement>, fnShowMenu?: (() => void)): boolean
  • Callback for when a right click was performed on a node. Selects or unselects the row, if that feature is enabled.

    Parameters

    • event: TriggeredEvent<any, any, any, any>

      The click event that occurred.

    • node: JQuery<HTMLElement>

      The node that was clicked.

    • Optional fnShowMenu: (() => void)

      Optional callback function invoked when the menu was opened.

        • (): void
        • Returns void

    Returns boolean

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

  • 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

  • propagateUp(node: JQuery<HTMLElement>): void
  • Propagates a select or unselect event up to the parents of the given row.

    Parameters

    • node: JQuery<HTMLElement>

      A node that was selected or unselected.

    Returns void

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

    Returns void

  • 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.

  • 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(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(nodeKey: string): void
  • Removes the given row from the list of currenlty selected rows.

    Parameters

    • nodeKey: string

      A row that was unselected.

    Returns void

  • 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(): 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

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

    Parameters

    Returns void

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

    Returns void

  • saveCell(cell: JQuery<HTMLElement>): void
  • 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

    • cell: JQuery<HTMLElement>

      A cell with an inline editor to save.

    Returns void

  • saveRowEdit(rowEditor: JQuery<HTMLElement>): void
  • When a row is currently being edited: Saves the edited row and hides the editors.

    Parameters

    • rowEditor: JQuery<HTMLElement>

      A row to save, must be a TR element.

    Returns void

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

    Returns void

  • selectNode(node: JQuery<HTMLElement>, silent?: boolean): void
  • 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

  • selectNodesInRange(node: JQuery<HTMLElement>): void
  • 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

    • node: JQuery<HTMLElement>

      A row that was just clicked.

    Returns void

  • setColumnsWidth(columns: JQuery<HTMLElement>): void
  • Applies the appropriated width to all given column elements.

    Parameters

    • columns: JQuery<HTMLElement>

      A list of column elements.

    Returns void

  • setOuterWidth(element: JQuery<HTMLElement>, width: number): void
  • 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

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

    Parameters

    • width: number

      The width of the scrollbar.

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

  • Checks whether the tree table should be sorted.

    Parameters

    • event: TriggeredEvent<any, any, any, any>

      Event that occurred.

    • column: JQuery<HTMLElement>

      Column that was clicked.

    Returns boolean

    Whether the tree table should be sorted.

  • showCellEditor(c: JQuery<HTMLElement>): void
  • Activates the inline editor for the given cell.

    Parameters

    • c: JQuery<HTMLElement>

      The cell TD element for which to activate the inline editor.

    Returns void

  • showCurrentCell(cell: JQuery<HTMLElement>): void
  • 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

  • showRowEditors(row: JQuery<HTMLElement>): void
  • Hides the row and display the row editors.

    Parameters

    • row: JQuery<HTMLElement>

      A row for which to show the editors.

    Returns void

  • 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: PrimeFaces.widget.TreeTable.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(row: JQuery<HTMLElement>): void
  • 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

  • tabCell(cell: JQuery<HTMLElement>, forward: boolean): void
  • 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(node: JQuery<HTMLElement>): void
  • When the TreeTableCfg.selectionMode is set to checkbox: select the given row if is is currently unselected, or unselects it otherwise.

    Parameters

    • node: JQuery<HTMLElement>

      A row to toggle, must be a TR element.

    Returns void

  • unselectAllNodes(): void
  • unselectNode(node: JQuery<HTMLElement>, silent?: boolean): void
  • 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

  • updateResizableState(columnHeader: JQuery<HTMLElement>, nextColumnHeader: JQuery<HTMLElement>, table: JQuery<HTMLElement>, newWidth: number, nextColumnWidth: null | number): void
  • 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

  • updateRows(row: JQuery<HTMLElement>, content: string | HTMLElement | JQuery<HTMLElement> | HTMLElement[]): void
  • Updates a row with the given HTML content.

    Parameters

    • row: JQuery<HTMLElement>

      A row to update.

    • content: string | HTMLElement | JQuery<HTMLElement> | HTMLElement[]

      The new HTML content of the row.

    Returns void

  • 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

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

    Returns void

  • viewMode(cell: JQuery<HTMLElement>): void
  • Switch from edit mode to view mode, Hides the inline editor and displays the data.

    Parameters

    • cell: JQuery<HTMLElement>

      The cell with an activate inline editor to hide.

    Returns void

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

    Returns void

Generated using TypeDoc