GtBridge.Phlow.Column (gt_bridge v0.17.1)

Copy Markdown View Source

A column definition for columned list and tree views.

Summary

Functions

Convert the column to a dictionary for serialization.

Set the format function for the column.

Format an item using the column's format function.

Create a new column with a title.

Set the width of the column.

Types

t()

@type t() :: %GtBridge.Phlow.Column{
  format: (any() -> String.t()) | nil,
  title: String.t(),
  width: integer() | nil
}

Functions

as_dict(self)

@spec as_dict(t()) :: map()

Convert the column to a dictionary for serialization.

format(self, format_fn)

@spec format(t(), (any() -> String.t())) :: t()

Set the format function for the column.

format_item(self, item)

@spec format_item(t(), any()) :: String.t()

Format an item using the column's format function.

new(title)

@spec new(String.t()) :: t()

Create a new column with a title.

width(self, width_value)

@spec width(t(), integer()) :: t()

Set the width of the column.