Options
All
  • Public
  • Public/Protected
  • All
Menu

PrimeFaces DataTable with Frozen Columns Widget

Type parameters

Hierarchy

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 FrozenDataTable<TCfg>

Properties

Protected SORT_ORDER

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

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

allLoadedLiveScroll

allLoadedLiveScroll: boolean

Whether all available items were already loaded.

Optional ascMessage

ascMessage?: string

Localized message for sorting a column in ascending order.

bodyTable

bodyTable: JQuery<HTMLElement>

The DOM element for the body part of the table.

cacheMap

cacheMap: Record<number, string>

Cache for the contents of a row. Key is the row index, value the HTML content of the row.

cacheRows

cacheRows: number

Number of rows to cache.

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.

checkAllToggler

checkAllToggler: JQuery<HTMLElement>

DOM element of the container with the check all checkbox in the header.

clone

Clone of the table header.

columnWidthsFixed

columnWidthsFixed: boolean

Whether column widths are fixed or may be resized.

Optional contextMenuCell

contextMenuCell?: JQuery<HTMLElement>

DOM element of the table cell for which the context menu was opened.

contextMenuWidget

contextMenuWidget: ContextMenu<ContextMenuCfg>

Widget with the context menu for the DataTable.

currentCell

currentCell: JQuery<HTMLElement>

Current cell to be edited.

cursorIndex

cursorIndex: null | number

0-based index of row where the the cursor is located.

Optional descMessage

descMessage?: string

Localized message for sorting a column 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.

dragIndicatorBottom

dragIndicatorBottom: JQuery<HTMLElement>

DOM element of the icon that indicates a column is draggable.

dragIndicatorTop

dragIndicatorTop: JQuery<HTMLElement>

DOM element of the icon that indicates a column is draggable.

Optional expansionHolder

expansionHolder?: JQuery<HTMLElement>

DOM element of the hidden input that holds the row keys of the rows that are expanded. Used to preserve the expansion state during AJAX updates.

expansionProcess

expansionProcess: number[]

List of row indices to expand.

filterTimeout

filterTimeout: number

ID as returned by setTimeout used during filtering.

focusedRow

focusedRow: null | JQuery<HTMLElement>

DOM element of the currently focused row.

focusedRowWithCheckbox

focusedRowWithCheckbox: boolean

Whether the focused row includes the checkbox for selecting the row.

footerCols

footerCols: JQuery<HTMLElement>

The DOM elements for the footer columns.

footerTable

footerTable: JQuery<HTMLElement>

The DOM elements for the footer table.

frozenBody

frozenBody: JQuery<HTMLElement>

The DOM element for the frozen body.

frozenBodyTable

frozenBodyTable: JQuery<HTMLElement>

The DOM element for the frozen body TABLE.

frozenColgroup

frozenColgroup: undefined

Always undefined and not used.

frozenContainer

frozenContainer: JQuery<HTMLElement>

The DOM element for the container of the frozen table.

frozenFooter

frozenFooter: JQuery<HTMLElement>

The DOM element for the frozen footer.

frozenFooterCols

frozenFooterCols: JQuery<HTMLElement>

The DOM elements for the frozen columns of the footer.

frozenFooterTable

frozenFooterTable: JQuery<HTMLElement>

The DOM element for the frozen data table footer TABLE.

frozenGroupResizers

frozenGroupResizers: JQuery<HTMLElement>

The DOM element for the frozen group resizers of the footer.

frozenHeader

frozenHeader: JQuery<HTMLElement>

The DOM element for the frozen header.

frozenLayout

frozenLayout: JQuery<HTMLElement>

The DOM element for the frozen layout container.

frozenTbody

frozenTbody: JQuery<HTMLElement>

The DOM element for the header TBODY.

frozenThead

frozenThead: JQuery<HTMLElement>

The DOM element for the header THEAD.

frozenTheadClone

frozenTheadClone: JQuery<HTMLElement>

The DOM element for the clone of the frozen THEAD.

groupResizers

groupResizers: JQuery<HTMLElement>

The DOM elements for the resizer button of each group.

hasColumnGroup

hasColumnGroup: boolean

Whether the table has any column groups.

headerTable

headerTable: JQuery<HTMLElement>

The DOM elements for the header table.

headers

DOM elements for the TH headers of this DataTable.

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.

ignoreRowHoverEvent

ignoreRowHoverEvent: boolean

Whether to ignore row hover event.

isRTL

isRTL: boolean

Whether the writing direction is set to right-to-left.

isRowTogglerClicked

isRowTogglerClicked: boolean

Whether a row toggler was clicked.

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

liveScrollActive

liveScrollActive: boolean

Whether live scrolling is currently active.

Optional loadedExpansionRows

loadedExpansionRows?: string[]

List of row keys of the expansion rows that had their content already loaded via AJAX.

loadingLiveScroll

loadingLiveScroll: boolean

Whether data is currently being loaded due to the live scrolling feature.

mousedownOnRow

mousedownOnRow: boolean

Whether a mousedown event occurred on a row.

orderStateHolder

orderStateHolder: JQuery<HTMLElement>

INPUT element storing the current column / row order.

originRowIndex

originRowIndex: null | number

The original row index of the row that was clicked.

Optional otherMessage

otherMessage?: string

Localized message for removing the sort order and showing rows in their original order.

paginator

When pagination is enabled: The paginator widget instance used for paging.

percentageScrollHeight

percentageScrollHeight: boolean

The current relative vertical scroll position.

percentageScrollWidth

percentageScrollWidth: boolean

The current relative horizontal scroll position.

reflowDD

reflowDD: boolean

true if reflow is enabled, false otherwise.

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 table viewport, relative to the total height, used for scrolling.

resizableState

resizableState: string[]

A list with the current widths for each resizable column.

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 resize helper.

Optional rowHeight

rowHeight?: number

Constant height in pixels for each row, when virtual scrolling is enabled.

rowSelector

rowSelector: string

The CSS selector for the table rows.

rowSelectorForRowClick

rowSelectorForRowClick: string

The CSS selector for the table rows that can be clicked.

scrollBody

scrollBody: JQuery<HTMLElement>

The DOM element for the scrollable body of the table.

scrollBodyTable

scrollBodyTable: JQuery<HTMLElement>

The DOM element for the TABLE of the scrollable body.

scrollColgroup

scrollColgroup: undefined

Always undefined and not used.

scrollContainer

scrollContainer: JQuery<HTMLElement>

The DOM element for the container of the scrollable body.

scrollFooter

scrollFooter: JQuery<HTMLElement>

The DOM element for the scrollable body of the table.

scrollFooterBox

scrollFooterBox: JQuery<HTMLElement>

The DOM element for the scrollable footer box of the table.

scrollFooterCols

scrollFooterCols: JQuery<HTMLElement>

The DOM element for the scrollable columns of the footer.

scrollFooterTable

scrollFooterTable: JQuery<HTMLElement>

The DOM element for the TABLE of the scrollable footer.

scrollGroupResizers

scrollGroupResizers: JQuery<HTMLElement>

The DOM element for the group resizers of the scrollable body.

scrollHeader

scrollHeader: JQuery<HTMLElement>

The DOM element for the scrollable header of the table.

scrollHeaderBox

scrollHeaderBox: JQuery<HTMLElement>

The DOM element for the scrollable header box of the table.

scrollHeaderTable

scrollHeaderTable: JQuery<HTMLElement>

The DOM element for the TABLE of the scrollable header.

scrollLayout

scrollLayout: JQuery<HTMLElement>

The DOM element for the scrollable layout container.

scrollOffset

scrollOffset: number

The current scroll position.

scrollStateHolder

scrollStateHolder: JQuery<HTMLElement>

INPUT element storing the current scroll position.

scrollTbody

scrollTbody: JQuery<HTMLElement>

The DOM element for the scrollable TBODY.

scrollThead

scrollThead: JQuery<HTMLElement>

The DOM element for the scrollable THEAD.

scrollTheadClone

scrollTheadClone: JQuery<HTMLElement>

The DOM element for the clone of the scrollable THEAD.

scrollTimeout

scrollTimeout: number

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

scrollbarWidth

scrollbarWidth: string

CSS attribute for the scrollbar width, eg. 20px.

selection

selection: string[]

List of row keys for the currently selected rows.

selectionHolder

selectionHolder: string

ID of the INPUT element storing the currently selected rows.

shouldLiveScroll

shouldLiveScroll: boolean

Whether live scrolling is currently enabled.

sortMeta

sortMeta: Record<string, SortMeta>

Information about how each column is sorted. Key is the column key.

sortableColumns

sortableColumns: JQuery<HTMLElement>

DOM elements for the columns that are sortable.

stickyContainer

stickyContainer: JQuery<HTMLElement>

The DOM element for the sticky container of the table.

tbody

DOM element of the TBODY element of this DataTable, if it exists.

tfoot

DOM element of the TFOOT element of this DataTable, if it exists.

thead

DOM element of the THEAD element of this DataTable, if it exists.

theadClone

theadClone: JQuery<HTMLElement>

The DOM element for the cloned table head.

virtualScrollActive

virtualScrollActive: boolean

Whether virtual scrolling is currently active.

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 _addGhostRow

  • Adds an invisible row for internal purposes.

    Parameters

    Returns void

Protected _findGroupResizer

Protected _fixColumnWidths

  • Adjusts the width of the given columns to fit the current settings.

    Parameters

    Returns void

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

Protected addGhostRow

  • addGhostRow(): void
  • Adds and sets up an invisible row for internal purposes.

    override

    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

Protected addResizers

  • addResizers(): void
  • Adds the resizers for change the width of a column of this DataTable.

    override

    Returns void

addRow

  • addRow(): void
  • Fetches the last row from the backend and inserts a row instead of updating the table itself.

    Returns void

Protected adjustScrollHeight

  • adjustScrollHeight(): void
  • Adjusts the height of the body of this DataTable for the current scrolling settings.

    override

    Returns void

Protected adjustScrollWidth

  • adjustScrollWidth(): void
  • Adjusts the width of the header, body, and footer of this DataTable to fit the current settings.

    override

    Returns void

Protected assignFocusedRow

Protected bindCheckboxEvents

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

      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

Protected bindExpansionEvents

  • bindExpansionEvents(): void

Protected bindRadioEvents

  • bindRadioEvents(): void
  • Sets up the event listeners for radio buttons contained in this DataTable.

    Returns void

Protected bindRowHover

  • bindRowHover(selector: string): void
  • Sets up the event listeners for hovering over a DataTable row.

    override

    Parameters

    • selector: string

      Selector for the row elements. Any hover event that does not reach an element that matches this selector will be ignored.

    Returns void

Protected bindToggleRowGroupEvents

  • bindToggleRowGroupEvents(): 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 the given row is currently being edited, cancel the editing operation and discard the entered data. Use findRow to get a row by its index.

    Parameters

    Returns void

clearFilters

  • clearFilters(): void
  • Clears all table filters and shows all rows that may have been hidden by filters.

    Returns void

Protected cloneHead

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

    override

    Returns void

collapseAllRows

  • collapseAllRows(): void

Protected collapseRow

  • Collapses the given row, if it is expandable. Use findRow to get a row by its index. Does not update the row expansion toggler button.

    override

    Parameters

    Returns void

copyRow

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

Protected displayExpandedRow

  • Display the given HTML string in the specified row. Called mainly after an AJAX request.

    override

    Parameters

    • row: JQuery<HTMLElement>

      Row to display.

    • content: string

      HTML string of the content to add to the row

    Returns void

filter

  • filter(): void
  • Filters this DataTable. Uses the current values of the filter inputs. This will result in an AJAX request being sent.

    Returns void

Protected findGroupResizer

findRow

  • Converts a row specifier to the row element. The row specifier is either a row index or the row element itself.

    In case this DataTable has got expandable rows, please not that a new table row is created for each expanded row. This may result in the given index not pointing to the intended row.

    Parameters

    Returns JQuery<HTMLElement>

    The row, or an empty JQuery instance of no row was found.

Protected fixColumnWidths

  • fixColumnWidths(): void
  • Adjusts the width of the given columns to fit the current settings.

    override

    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.

getCellMeta

  • Finds the meta data for a given cell.

    Parameters

    Returns string

    The meta data of the given cell or NULL if not found

getExpandedRows

Protected getFocusableTbody

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

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.

Protected getRowEditors

  • Finds all editors of a row. Usually each editable column has got an editor.

    override

    Parameters

    Returns JQuery<HTMLElement>

    A list of row editors for each editable column of the given row

getRowMeta

  • Finds the index and the row key for the given row.

    Parameters

    Returns RowMeta

    The meta for the row with the index and the row key.

getSelectedRowsCount

  • getSelectedRowsCount(): number
  • Finds the number of rows that are selected.

    Returns number

    The number of rows that are currently selected.

getTbody

getTfoot

getThead

getTwinRow

  • Finds the twin row of the given row. The data table body has got two sets of rows.

    Parameters

    Returns JQuery<HTMLElement>

    DOM element of the twin row.

Protected groupRows

  • groupRows(): void
  • When row grouping is enabled, groups all rows accordingly.

    override

    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.

Protected hasColGroup

  • hasColGroup(): boolean
  • Checks whether this DataTable has got any column groups.

    override

    Returns boolean

    true if this DataTable has got any column groups, or false otherwise.

Protected hasVerticalOverflow

  • hasVerticalOverflow(): boolean
  • Checks whether the body of this DataTable overflow vertically.

    override

    Returns boolean

    true if any content overflow vertically, false otherwise.

Protected highlightFocusedRow

  • highlightFocusedRow(): void
  • Highlights the currently focused row (if any) by adding the appropriate CSS class.

    override

    Returns void

Protected highlightRow

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

invalidateRow

  • invalidateRow(index: number): void
  • Displays row editors in invalid format.

    override

    Parameters

    • index: number

      0-based index of the row to invalidate.

    Returns void

isCheckboxSelectionEnabled

  • isCheckboxSelectionEnabled(): boolean
  • Checks whether the rows of this DataTable are selected via checkboxes.

    Returns boolean

    true if selection mode 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 this DataTable has got any rows. When there are no rows, usually the message no items found is shown.

    Returns boolean

    true if this DataTable has got no rows, false otherwise.

isMultipleSelection

  • isMultipleSelection(): boolean
  • Checks whether multiples rows may be selected at a time.

    Returns boolean

    true if selection mode is set to multiple, or false otherwise.

isRadioSelectionEnabled

  • isRadioSelectionEnabled(): boolean
  • Checks whether the rows of this DataTable are selected via radio buttons.

    Returns boolean

    true if selection mode is set to radio, or false otherwise.

isSelected

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

    Parameters

    • rowKey: string

      The key of a row from this DataTable.

    Returns boolean

    true if the given row is currently selected, or false otherwise.

isSelectionEnabled

  • isSelectionEnabled(): boolean
  • Checks whether the user may select the rows of this DataTable.

    Returns boolean

    true is rows may be selected, or false otherwise.

isSingleSelection

  • isSingleSelection(): boolean
  • Checks whether only one row may be selected at a time.

    Returns boolean

    true if selection mode is set to single, or false otherwise.

loadLiveRows

  • loadLiveRows(): void
  • Use only when live scrolling is enabled: Loads the next set of rows on-the-fly.

    Returns void

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

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.

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

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

Protected resetVirtualScrollBody

  • resetVirtualScrollBody(): void

Protected resize

  • Resizes this DataTable, row, or columns in response to a drag event of a resizer element.

    override

    Parameters

    Returns void

saveCell

  • After the user is done editing a cell, saves the content of the given cell and switches back to view mode.

    Parameters

    Returns void

Protected saveColumnOrder

  • saveColumnOrder(): void
  • Saves the current column order, used to preserve the state between AJAX updates etc.

    override

    Returns void

saveRowEdit

  • When the given row is currently being edited, saves the contents of the edited row and switch back to view mode. Use findRow to get a row by its index.

    Parameters

    Returns void

selectAllRows

  • selectAllRows(): void
  • Selects all rows of this DataTable so that no rows are selected. This includes all rows on all pages, irrespective of whether they are on the currently shown page.

    Returns void

selectAllRowsOnPage

  • selectAllRowsOnPage(): void

selectRow

  • Selects the given row, according to the current selection mode.

    Parameters

    • r: RowSpecifier

      A row of this DataTable to select.

    • Optional silent: boolean

      true to prevent behaviors and event listeners from being invoked, or false otherwise.

    Returns void

Protected setScrollWidth

  • setScrollWidth(width: number): void
  • Applies the given scroll width to this DataTable.

    override

    Parameters

    • width: number

      Scroll width in pixels to set.

    Returns void

Protected setupScrolling

  • setupScrolling(): void
  • Prepares this DataTable for the current scrolling settings and sets up all related event handlers.

    override

    Returns void

showCellEditor

  • When cell editing is enabled, shows the cell editor for the given cell that lets the user edit the cell content.

    Parameters

    Returns void

Protected showRowEditors

  • Shows the row editor(s) for the given row (and hides the normal output display).

    override

    Parameters

    Returns void

switchToRowEdit

  • Switch all editable columns of the given row to their editing mode, if editing is enabled on this DataTable. Use findRow to get a row by its index.

    Parameters

    Returns void

toggleCheckAll

  • toggleCheckAll(): void
  • Toggles the selected all checkbox in the header of this DataTable. When no rows are selected, this will select all rows. When some rows are selected, this will unselect all rows.

    Returns void

toggleRow

  • Expands or collapses the given row, depending on whether it is currently collapsed or expanded, respectively.

    Parameters

    Returns void

Protected unhighlightFocusedRow

  • unhighlightFocusedRow(): void

Protected unhighlightRow

unselectAllRows

  • unselectAllRows(): void
  • Unselects all rows of this DataTable so that no rows are selected. This includes all rows on all pages, irrespective of whether they are on the currently shown page.

    Returns void

unselectAllRowsOnPage

  • unselectAllRowsOnPage(): void

unselectRow

  • Unselects the given row.

    Parameters

    • r: RowSpecifier

      A row of this DataTable to unselect.

    • Optional silent: boolean

      true to prevent behaviors and event listeners from being invoked, or false otherwise.

    Returns void

Protected updateData

  • updateData(data: string, clear: undefined | boolean): void
  • Sets the given HTML string as the content of the body of this DataTable. Afterwards, sets up all required event listeners etc.

    override

    Parameters

    • data: string

      HTML string to set on the body.

    • clear: undefined | boolean

      Whether the contents of the table body should be removed beforehand.

    Returns void

Protected updateRow

  • Updates a row with the given content

    override

    Parameters

    • row: JQuery<HTMLElement>

      Row to update.

    • content: string

      HTML string to set on the row.

    Returns void

Generated using TypeDoc