1. Domino UI
  2. Data table
  3. Sort and Search
Top Sort and Search Docs

Sort and Search

A DataTable plugin that adds header filters to the DataTable. Header filters are used to filter data in the DataTable based on the values in the column headers.

T

The type of data in the DataTable.

A plugin for adding sorting functionality to a DataTable. This plugin allows users to click on the table headers to sort the data in ascending or descending order.

T

The type of data in the DataTable.

Examples

API Docs: ColumnHeaderFilterPlugin

Static methods

public static ColumnHeaderFilterPlugin<T> create()
Creates a new instance of the ColumnHeaderFilterPlugin.

T

The type of data in the DataTable.



Returns:

A new ColumnHeaderFilterPlugin instance.

Public methods

public void init(DataTable<T> dataTable)
Initializes the ColumnHeaderFilterPlugin for a specific DataTable instance.

dataTable

The DataTable to which this plugin is attached.

public void onAfterAddHeaders(DataTable<T> dataTable)
Adds header filters to the DataTable after the headers have been added.

dataTable

The DataTable to which the header filters are added.

public void handleEvent(DominoEvent event)
Handles table events, such as clearing the filters when a search is cleared.

event

The table event to handle.

public TableRowElement getFiltersRowElement()
Gets the HTML element that contains the header filters.

Returns:

The TableRowElement containing the header filters.

public int order()
Specifies the order in which this plugin should be executed. Plugins with lower order values are executed first.

Returns:

The order value for this plugin.

API Docs: SortPlugin

Public methods

public void init(DataTable<T> dataTable)
Initializes the plugin with the DataTable instance.

dataTable

The DataTable instance to which this plugin is applied.

public void onHeaderAdded(DataTable<T> dataTable, ColumnConfig<T> column)
Adds sorting functionality to the table header columns that are marked as sortable.

dataTable

The DataTable instance to which this plugin is applied.

column

The column configuration to which sorting functionality is added.

public void sort(SortDirection direction, ColumnConfig<T> column)
Sorts the table data in the specified direction for the given column.

direction

The sorting direction (ascending or descending).

column

The column to be sorted.

public void handleEvent(DominoEvent event)
Handles sorting-related events, such as DataSortEvent.

event

The event to handle.

public SortPlugin<T> setConfig(SortPluginConfig config)
Sets the configuration for this plugin.

config

The SortPluginConfig to set.



Returns:

This SortPlugin instance for method chaining.

public SortPluginConfig getConfig()
Gets the current configuration for this plugin.

Returns:

The SortPluginConfig.

public SortPlugin<T> configure(Consumer<SortPluginConfig> handler)
Configures the SortPlugin using a consumer that modifies the configuration settings.

handler

The consumer to apply configuration changes.



Returns:

This SortPlugin instance for method chaining.

API Docs: SortPluginConfig

Public methods

public boolean isTriStateSort()
Checks if tri-state sorting is enabled.

Returns:

true if tri-state sorting is enabled, false otherwise.

public SortPluginConfig setTriStateSort(boolean triStateSort)
Sets whether tri-state sorting is enabled.

triStateSort

true to enable tri-state sorting, false to disable.



Returns:

This SortPluginConfig instance for method chaining.

public Supplier<Icon<?>> getAscendingIcon()
Gets the supplier for the ascending sorting icon.

Returns:

The supplier for the ascending sorting icon.

public SortPluginConfig setAscendingIcon(Supplier<Icon<?>> ascendingIcon)
Sets the supplier for the ascending sorting icon.

ascendingIcon

The supplier for the ascending sorting icon.



Returns:

This SortPluginConfig instance for method chaining.

public Supplier<Icon<?>> getDescendingIcon()
Gets the supplier for the descending sorting icon.

Returns:

The supplier for the descending sorting icon.

public SortPluginConfig setDescendingIcon(Supplier<Icon<?>> descendingIcon)
Sets the supplier for the descending sorting icon.

descendingIcon

The supplier for the descending sorting icon.



Returns:

This SortPluginConfig instance for method chaining.

public Supplier<Icon<?>> getUnsortedIcon()
Gets the supplier for the unsorted icon.

Returns:

The supplier for the unsorted icon.

public SortPluginConfig setUnsortedIcon(Supplier<Icon<?>> unsortedIcon)
Sets the supplier for the unsorted icon.

unsortedIcon

The supplier for the unsorted icon.



Returns:

This SortPluginConfig instance for method chaining.

public boolean isShowIconOnSortedColumnOnly()
Checks if icons are displayed only on the sorted column.

Returns:

true if icons are displayed only on the sorted column, false otherwise.

public SortPluginConfig setShowIconOnSortedColumnOnly(boolean showIconOnSortedColumnOnly)
Sets whether icons should be displayed only on the sorted column.

showIconOnSortedColumnOnly

true to display icons only on the sorted column, false otherwise.



Returns:

This SortPluginConfig instance for method chaining.

public boolean isShowSortOptionsInColumnMenu()
Checks whether sort options are shown in the column menu.

Returns:

true if sort options are displayed in the column menu, false otherwise

public SortPluginConfig setShowSortOptionsInColumnMenu(boolean showSortOptionsInColumnMenu)
Sets whether sort options should be shown in the column menu.

showSortOptionsInColumnMenu

true to display sort options in the column menu, false to hide them



Returns:

This SortPluginConfig instance for method chaining.

public String getSortAscendingLabel()
Returns the label text used for the "Sort Ascending" option.

Returns:

the "Sort Ascending" label, or null if not set

public void setSortAscendingLabel(String sortAscendingLabel)
Sets the label text for the "Sort Ascending" option.

sortAscendingLabel

the label to use for the "Sort Ascending" option

public String getSortDescendingLabel()
Returns the label text used for the "Sort Descending" option.

Returns:

the "Sort Descending" label, or null if not set

public void setSortDescendingLabel(String sortDescendingLabel)
Sets the label text for the "Sort Descending" option.

sortDescendingLabel

the label to use for the "Sort Descending" option

public String getNoSortLabel()
Returns the label text used for the "No Sort" option.

Returns:

the "No Sort" label, or null if not set

public void setNoSortLabel(String noSortLabel)
Sets the label text for the "No Sort" option.

noSortLabel

the label to use for the "No Sort" option

We are a group of passionate people who love what we do

Donate & Support Us