gribouille/elm-table/5.0.0

NOTE: the latest version is 5.3.0

Table

Full featured table.

Data

type alias Model a =
Model a

Model of component (opaque).

type alias Row a =
Row a

Table's row (opaque).

type alias Rows a =
Rows a

List of table's rows (opaque).

type alias RowID =
RowID

Unique ID of one row.

init : Config a b msg -> Model a

Initialize the table's model.

loaded : Model a -> List a -> Int -> Model a

Load the data in the model with the total number of rows if the data are incomplete.

loadedDynamic : List a -> Int -> Model a -> Model a

Similar to loaded. Load partial data in the model and specified the total number of rows.

loadedStatic : List a -> Model a -> Model a

Similar to loaded with all data so List.length rows == total.

loading : Model a -> Model a

Data loading is in progress.

failed : Model a -> String -> Model a

Data loading has failed.

State

type alias Pipe msg =
Pipe msg

Pipe for the table's messages to change the state.

type alias State =
State

Internal table's state.

selected : Model a -> List RowID

Return the list of selected rows.

subSelected : Model a -> List RowID

Return the list of selected rows in the sub tables.

Configuration

type alias Config a b msg =
Config a b msg

Table's configuration (opaque).

type alias Column a msg =
Column a msg

Column's configuration (opaque).

(Model a -> msg)
-> (a -> String)
-> List (Column a msg)
-> Config a () msg

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

(Model a -> msg)
-> (Model a -> msg)
-> (a -> String)
-> List (Column a msg)
-> Config a () msg

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

View

view : Config a b msg -> Model a -> Html msg

Table's view.

subscriptions : Config a b msg -> Model a -> Sub msg

Table's subscriptions.