Defaults to FrozenDataTableCfg
. Type of the configuration object for this widget.
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.
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.
Map between the sort order names and the multiplier for the comparator.
Whether all available items were already loaded.
Localized message for sorting a column in ascending order.
The DOM element for the body part of the table.
Cache for the contents of a row. Key is the row index, value the HTML content of the row.
Number of rows to cache.
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.
DOM element of the container with the check all
checkbox in the header.
Clone of the table header.
Whether column widths are fixed or may be resized.
DOM element of the table cell for which the context menu was opened.
Widget with the context menu for the DataTable.
Current cell to be edited.
0-based index of row where the the cursor is located.
Localized message for sorting a column in descending order.
Array of registered listeners invoked when this widget is destroyed. You should normally not use modify this directly, use addDestroyListener instead.
DOM element of the icon that indicates a column is draggable.
DOM element of the icon that indicates a column is draggable.
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.
List of row indices to expand.
ID as returned by setTimeout
used during filtering.
DOM element of the currently focused row.
Whether the focused row includes the checkbox for selecting the row.
The DOM elements for the footer columns.
The DOM elements for the footer table.
The DOM element for the frozen body.
The DOM element for the frozen body TABLE.
Always undefined
and not used.
The DOM element for the container of the frozen table.
The DOM element for the frozen footer.
The DOM elements for the frozen columns of the footer.
The DOM element for the frozen data table footer TABLE.
The DOM element for the frozen group resizers of the footer.
The DOM element for the frozen header.
The DOM element for the frozen layout container.
The DOM element for the header TBODY.
The DOM element for the header TFOOT.
The DOM element for the header THEAD.
The DOM element for the clone of the frozen THEAD.
The DOM elements for the resizer button of each group.
Whether the table has any column groups.
The DOM elements for the header table.
DOM elements for the TH
headers of this DataTable.
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.
Whether to ignore row hover event.
Whether the writing direction is set to right-to-left.
Whether a row toggler was clicked.
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.
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)
.
Whether live scrolling is currently active.
List of row keys of the expansion rows that had their content already loaded via AJAX.
Whether data is currently being loaded due to the live scrolling feature.
Whether a mousedown event occurred on a row.
INPUT element storing the current column / row order.
The original row index of the row that was clicked.
Localized message for removing the sort order and showing rows in their original order.
When pagination is enabled: The paginator widget instance used for paging.
The current relative vertical scroll position.
The current relative horizontal scroll position.
true
if reflow is enabled, false
otherwise.
Array of registered listeners invoked when this widget is refreshed. You should normally not use modify this directly, use addRefreshListener instead.
The height of the table viewport, relative to the total height, used for scrolling.
A list with the current widths for each resizable column.
INPUT element storing the current widths for each resizable column.
The set-timeout timer ID of the timer used for resizing.
The DOM element for the resize helper.
Constant height in pixels for each row, when virtual scrolling is enabled.
The CSS selector for the table rows.
The CSS selector for the table rows that can be clicked.
The DOM element for the scrollable body of the table.
The DOM element for the TABLE of the scrollable body.
Always undefined
and not used.
The DOM element for the container of the scrollable body.
The DOM element for the scrollable body of the table.
The DOM element for the scrollable footer box of the table.
The DOM element for the scrollable columns of the footer.
The DOM element for the TABLE of the scrollable footer.
The DOM element for the group resizers of the scrollable body.
The DOM element for the scrollable header of the table.
The DOM element for the scrollable header box of the table.
The DOM element for the TABLE of the scrollable header.
The DOM element for the scrollable layout container.
The current scroll position.
INPUT element storing the current scroll position.
The DOM element for the scrollable TBODY.
The DOM element for the scrollable TFOOT.
The DOM element for the scrollable THEAD.
The DOM element for the clone of the scrollable THEAD.
The set-timeout timer ID of the timer used for scrolling.
CSS attribute for the scrollbar width, eg. 20px
.
List of row keys for the currently selected rows.
ID of the INPUT element storing the currently selected rows.
Whether live scrolling is currently enabled.
Information about how each column is sorted. Key is the column key.
DOM elements for the columns that are sortable.
The DOM element for the sticky container of the table.
DOM element of the TBODY
element of this DataTable, if it exists.
DOM element of the TFOOT
element of this DataTable, if it exists.
DOM element of the THEAD
element of this DataTable, if it exists.
The DOM element for the cloned table head.
Whether virtual scrolling is currently active.
The name of the widget variables of this widget. The widget variable can be used to
access a widget instance by calling PF('myWidgetVar')
.
Adds an invisible row for internal purposes.
Body of this data table.
Header of this data table.
Cloned header of this data table, see method cloneHead
.
Footer of this data table.
Optional CSS class for the ghost columns.
Finds the resizer DOM element that matches the given draggable event params.
Data of the drag event.
List of all available resizers.
DOM element of the resizer.
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.
Adds a deferred rendering task for the given widget to the queue.
The ID of a deferred widget.
The container element that should be visible.
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.
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.
A destroy listener to be registered.
Adds and sets up an invisible row for internal purposes.
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
.
A refresh listener to be registered.
Adds the resizers for change the width of a column of this DataTable.
Fetches the last row from the backend and inserts a row instead of updating the table itself.
Adjusts the height of the body of this DataTable for the current scrolling settings.
Adjusts the width of the header, body, and footer of this DataTable to fit the current settings.
Stores the row which is currently focused.
Row to set as the focused row.
Sets up the event listeners for radio buttons contained in this DataTable.
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.
The widget instance of the context menu.
The widget instance of the target widget that wants to add a context menu.
ID selector or DOM element of the target, i.e. the element the context menu belongs to.
The current configuration of the context menu.
Applies events related to row expansion in a non-obtrusive way
Sets up the event listeners for radio buttons contained in this DataTable.
Sets up the event listeners for hovering over a DataTable row.
Selector for the row elements. Any hover event that does not reach an element that matches this selector will be ignored.
Sets up the event handlers for row group events.
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="..." />
.
The name of an event to call.
Additional configuration that is passed to the AJAX request for the server-side callback.
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.
A row (TR
) in edit mode.
Clears all table filters and shows all rows that may have been hidden by filters.
Creates and stores a cloned copy of the table head(er) of this DataTable, and sets up some event handlers.
Collapses all rows that are currently expanded.
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.
Row to collapse.
Cleans up deferred render tasks. When you extend this class and override this method, make sure to call
super
.
Display the given HTML string in the specified row. Called mainly after an AJAX request.
Row to display.
HTML string of the content to add to the row
Filters this DataTable. Uses the current values of the filter inputs. This will result in an AJAX request being sent.
Finds the group resizer element for the given drag event data.
Data of the drag event.
(from super type DataTable) Data for the drag event.
The resizer DOM element.
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.
The row to convert.
The row, or an empty JQuery instance of no row was found.
Adjusts the width of the given columns to fit the current settings.
Adjusts the height of all rows to fit the current settings.
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="..." />
.
The name of an event for which to retrieve the behavior.
The behavior with the given name, or null
if no such behavior
exists.
Finds the meta data for a given cell.
A cell for which to get the meta data.
The meta data of the given cell or NULL if not found
Finds the list of row that are currently expanded.
All rows (TR
) that are currently expanded.
Finds the body of this DataTable with the property that the user can focus it.
The body of this DataTable.
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.
The jQuery instance representing the main HTML container element of this widget.
Returns the paginator instance if any exists.
The paginator instance for this widget, or undefined
if
paging is not enabled.
Gets the closest parent form for this widget.
A JQuery instance that either contains the form when found, or an empty JQuery instance when the form could not be found.
Gets the closest parent form ID for this widget lazily so it can be used in AJAX requests.
Either the form ID or undefined
if no form can be found.
Finds the number of rows that are selected.
The number of rows that are currently selected.
Retrieves the table body of this DataTable.
DOM element of the table body.
Retrieves the table footer of this DataTable.
DOM element of the table footer.
Retrieves the table header of this DataTable.
DOM element of the table header.
When row grouping is enabled, groups all rows accordingly.
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="..." />
.
The name of an event to check.
true
if this widget has the given behavior, false
otherwise.
Checks whether this DataTable has got any column groups.
true
if this DataTable has got any column groups, or false
otherwise.
Checks whether the body of this DataTable overflow vertically.
true
if any content overflow vertically, false
otherwise.
Highlights the currently focused row (if any) by adding the appropriate CSS class.
Highlights row to mark it as selected.
Row to highlight.
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
}
});
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.
Displays row editors in invalid format.
0-based index of the row to invalidate.
Checks whether the rows of this DataTable are selected via checkboxes.
true
if selection mode is set to checkbox
, or false
otherwise.
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.
true
if this widget is currently detached, or false
otherwise.
Checks whether this DataTable has got any rows. When there are no rows, usually the message no items found
is
shown.
true
if this DataTable has got no rows, false
otherwise.
Checks whether multiples rows may be selected at a time.
true
if selection mode is set to multiple
, or false
otherwise.
Checks whether the rows of this DataTable are selected via radio buttons.
true
if selection mode is set to radio
, or false
otherwise.
Checks whether the given row is currently selected.
The key of a row from this DataTable.
true
if the given row is currently selected, or false
otherwise.
Checks whether the user may select the rows of this DataTable.
true
is rows may be selected, or false
otherwise.
Checks whether only one row may be selected at a time.
true
if selection mode is set to single
, or false
otherwise.
Use only when live scrolling is enabled: Loads the next set of rows on-the-fly.
Called after the widget has become visible and after it was rendered. May be overridden, the default implementation is a no-op.
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.
The new widget configuration from the server.
The value as returned by the init
method, which is often undefined
.
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.
The client-side ID of the widget.
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.
true
if the widget container is visible, false
or
undefined
otherwise.
Resets the scroll state of the body to a non-scrolled state.
Resizes this DataTable, row, or columns in response to a drag event of a resizer element.
Event triggered for the drag.
Data for the drag event.
After the user is done editing a cell, saves the content of the given cell and switches back to view mode.
A cell (TD
) in edit mode.
Saves the current column order, used to preserve the state between AJAX updates etc.
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.
A row (TR
) in edit mode to save.
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.
Select all rows on the currently shown page. Compare with selectAllRows
.
Selects the given row, according to the current selection mode.
A row of this DataTable to select.
true
to prevent behaviors and event listeners from being invoked, or false
otherwise.
Applies the given scroll width to this DataTable.
Scroll width in pixels to set.
Prepares this DataTable for the current scrolling settings and sets up all related event handlers.
When cell editing is enabled, shows the cell editor for the given cell that lets the user edit the cell content.
A cell (TD
) of this DataTable to edit.
Shows the row editor(s) for the given row (and hides the normal output display).
Row for which to show the row editor.
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.
A row (TR
) to switch to edit mode.
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.
Expands or collapses the given row, depending on whether it is currently collapsed or expanded, respectively.
A row (TR
) to expand or collapse.
Unhighlights the currently focused row (if any) by adding the appropriate CSS class.
Removes the highlight of a row so it is no longer marked as selected.
Row to unhighlight.
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.
Unselect all rows on the currently shown page. Compare with unselectAllRows
.
Unselects the given row.
A row of this DataTable to unselect.
true
to prevent behaviors and event listeners from being invoked, or false
otherwise.
Sets the given HTML string as the content of the body of this DataTable. Afterwards, sets up all required event listeners etc.
HTML string to set on the body.
Whether the contents of the table body should be removed beforehand.
Updates a row with the given content
Row to update.
HTML string to set on the row.
Generated using TypeDoc
PrimeFaces DataTable with Frozen Columns Widget