gribouille / elm-table / Table.Config

Configuration of the table.


type alias Config a b msg =
Internal.Config.Config a b msg

Table's configuration (opaque).

Constructors

static : (Internal.Data.Model a -> msg) -> (a -> String) -> List (Table.Column.Column a msg) -> Config a () msg

Define a configuration for a table with static data (i.e. with all loaded data at once).

dynamic : (Internal.Data.Model a -> msg) -> (Internal.Data.Model a -> msg) -> (a -> String) -> List (Table.Column.Column a msg) -> Config a () msg

Define a configuration for a table with dynamic data (i.e. with paginated loaded data).

Customizations

withExpand : Table.Column.Column a msg -> Config a b msg -> Config a b msg

Add an full-width expandable row.

withSelection : Table.Types.Selection -> Config a b msg -> Config a b msg

Enable the selection (see Selection type for the different logics).

withSelectionFree : Config a b msg -> Config a b msg

Enable the selection with the free logic (see Selection for more details).

withSelectionLinked : Config a b msg -> Config a b msg

Enable the selection with the linked logic (see Selection for more details).

withSelectionLinkedStrict : Config a b msg -> Config a b msg

Enable the selection with the linked logic (see Selection for more details).

withSelectionExclusive : Config a b msg -> Config a b msg

Enable the selection with the exclusive logic (see Selection for more details).

withSelectionExclusiveStrict : Config a b msg -> Config a b msg

Enable the selection with the strict excluive logic (see Selection for more details).

withPagination : List Basics.Int -> Basics.Int -> Config a b msg -> Config a b msg

Enable the pagination and define the page sizes and the detault page size.

withProgressiveLoading : Basics.Int -> Basics.Int -> Config a b msg -> Config a b msg

Enable the progressive loading pagination (not implemented).

withToolbar : List (Html msg) -> Config a b msg -> Config a b msg

Add a custom toolbar.

withErrorView : (String -> Html msg) -> Config a b msg -> Config a b msg

Define a specific error message.

withSubtable : (a -> List b) -> (b -> String) -> List (Table.Column.Column b msg) -> Maybe (Table.Column.Column b msg) -> Config a () msg -> Config a b msg

Define a subtable.

withActions : List Table.Types.Action -> Config a b msg -> Config a b msg

Configure how the internal actions which will be process (by internal or external messages). This function is usefull only for the dynamic table.

Example:

Table.dynamic
    OnTableExternal
    OnTableInternal
    .id
    columns
    |> Config.withActions [ SearchEnter, ChangeByPage, ChangePageIndex, SortColumn ]

In this example the actions SearchEnter, ChangeByPage, ChangePageIndex, SortColumn will be send through the OnTableExternal message and all other actions will be send through the OnTableInternal message.