gribouille/elm-table/5.1.0

NOTE: the latest version is 5.3.0

Table.Column

Configure the table's columns.

type alias Column a msg =
Column a msg

Column's configuration (opaque).

type alias ViewCell a msg =
ViewCell a msg

Function to render a cell.

type alias ViewHeader a msg =
ViewHeader a msg

Function to render the column's header.

Constructors

bool : (a -> Bool) -> String -> String -> Column a msg

Create a column for booleans.

default : String -> String -> ViewCell a msg -> Column a msg

Create an agnostic column with a rendering function.

float : (a -> Float) -> String -> String -> Column a msg

Create a column for floats.

int : (a -> Int) -> String -> String -> Column a msg

Create an column for integers.

string : (a -> String) -> String -> String -> Column a msg

Create a column for strings.

Customization

withClass : String -> Column a msg -> Column a msg

Define a CSS class for the column.

withDefault : Bool -> Column a msg -> Column a msg

Define a column visible by default.

withHeaderView : ViewHeader a msg -> Column a msg -> Column a msg

Define a specific function to render the header.

withHiddable : Bool -> Column a msg -> Column a msg

Define a hiddable column.

withHidden : Column a msg -> Column a msg

Define a hidden column.

withSearchable : Maybe (a -> String) -> Column a msg -> Column a msg

Define a function to filter the data in the table (usefull only for the static table).

withSortable : Maybe (a -> a -> Order) -> Column a msg -> Column a msg

Define a function to sort the data (for the dynamic table, a fake function should be defined here and capture the pagination in the update function to load the sorted data).

withUnSortable : Column a msg -> Column a msg

Define an unsortable column.

withView : ViewCell a msg -> Column a msg -> Column a msg

Define a specific function to render the value.

withWidth : String -> Column a msg -> Column a msg

Define a static width (CSS value).