1. Domino UI
  2. Data table
  3. Column pin
Top Column pin Docs

Column pin

This plugin allows users to pin specific columns to the right or left of a DataTable . Pinned columns remain fixed when scrolling horizontally, making it easier to view important data while scrolling through a large dataset.

When you pin a column to the left, all columns to the left of the pinned column will also be pinned to the left. Similarly, pinning a column to the right will cause all columns to the right to be pinned to the right.

To pin a column to the left, use left when configuring the column:

 
 tableConfig.addColumn(ColumnConfig.create("name", "Label").applyMeta(PinColumnMeta.left()));
 

To pin a column to the right, use right :

 
 tableConfig.addColumn(ColumnConfig.create("name", "Label").applyMeta(PinColumnMeta.right()));
 

This plugin provides the ability to configure the pinning behavior, including enabling/disabling pinning icons and menus, and customizing the icon visuals.

Customization: You can customize the pin icons using Icon objects. By default, pin icons are taken from the Icons class.

Pin Menu: This plugin provides an optional pinning menu that can be shown when a column's header is right-clicked. The menu allows users to easily pin/unpin columns.

This plugin listens to various DataTable events such as column resizing and updates to ensure that pinned columns stay in the correct position.

Notes: - Pinning a column to the left will also pin all columns to the left of that column. - Pinning a column to the right will also pin all columns to the right of that column. - Pinned columns do not scroll horizontally with the table.

T

The type of data in the DataTable.

See also :

Examples

Column pin Allow the user to fix columns position on the sides of the data table.

API Docs: PinColumnsConfig

Constructors

public void PinColumnsConfig()
Default constructor for PinColumnsConfig.
public void PinColumnsConfig(boolean showPinIcon, boolean showPinMenu)
Constructor for PinColumnsConfig with options to show pin icon and pin menu.

showPinIcon

True to show pin icons, false otherwise.

showPinMenu

True to show the pin menu, false otherwise.

Static methods

public static PinColumnsConfig of()
Creates a new PinColumnsConfig instance with default settings.

Returns:

A new PinColumnsConfig instance.

public static PinColumnsConfig of(boolean showPinIcon, boolean showPinMenu)
Creates a new PinColumnsConfig instance with the specified settings.

showPinIcon

True to show pin icons, false otherwise.

showPinMenu

True to show the pin menu, false otherwise.



Returns:

A new PinColumnsConfig instance with the specified settings.

Public methods

public boolean isShowPinIcon()
Checks if pin icons are shown.

Returns:

True if pin icons are shown, false otherwise.

public PinColumnsConfig setShowPinIcon(boolean showPinIcon)
Sets whether to show pin icons.

showPinIcon

True to show pin icons, false otherwise.



Returns:

The PinColumnsConfig instance for method chaining.

public boolean isShowPinMenu()
Checks if the pin menu is shown.

Returns:

True if the pin menu is shown, false otherwise.

public PinColumnsConfig setShowPinMenu(boolean showPinMenu)
Sets whether to show the pin menu.

showPinMenu

True to show the pin menu, false otherwise.



Returns:

The PinColumnsConfig instance for method chaining.

public String getPinLeftText()
Gets the text label for the "Pin Left" action in the column menu.

Returns:

The text label for "Pin Left."

public void setPinLeftText(String pinLeftText)
Sets the text label for the "Pin Left" action in the column menu.

pinLeftText

The text label for "Pin Left."

public String getPinRightText()
Gets the text label for the "Pin Right" action in the column menu.

Returns:

The text label for "Pin Right."

public void setPinRightText(String pinRightText)
Sets the text label for the "Pin Right" action in the column menu.

pinRightText

The text label for "Pin Right."

public String getUnpinText()
Gets the text label for the "Unpin" action in the column menu.

Returns:

The text label for "Unpin."

public void setUnpinText(String unpinText)
Sets the text label for the "Unpin" action in the column menu.

unpinText

The text label for "Unpin."

public Icon<?> getPinLeftIcon()
Gets the icon used for pinning columns to the left side of the DataTable.

Returns:

The pin left icon.

public PinColumnsConfig setPinLeftIcon(Icon<?> pinLeftIcon)
Sets the icon used for pinning columns to the left side of the DataTable.

pinLeftIcon

The pin left icon.



Returns:

The PinColumnsConfig instance for method chaining.

public Icon<?> getPinRightIcon()
Gets the icon used for pinning columns to the right side of the DataTable.

Returns:

The pin right icon.

public PinColumnsConfig setPinRightIcon(Icon<?> pinRightIcon)
Sets the icon used for pinning columns to the right side of the DataTable.

pinRightIcon

The pin right icon.



Returns:

The PinColumnsConfig instance for method chaining.

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

Donate & Support Us