gribouille / elm-table / Table

Full featured table.

Data


type alias Model a =
Internal.Data.Model a

Model of component (opaque).


type alias Row a =
Internal.Data.Row a

Table's row (opaque).


type alias Rows a =
Internal.Data.Rows a

List of table's rows (opaque).


type alias RowID =
Internal.State.RowID

Unique ID of one row.

get : Model a -> List a

Get the loaded data.

init : Config a b msg -> Model a

Initialize the table's model.

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

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

loadedDynamic : List a -> Basics.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 =
Internal.Column.Pipe msg

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


type alias State =
Internal.State.State

Internal table's state.


type alias Pagination =
Internal.State.Pagination

Pagination values.

pagination : Model a -> Pagination

Get the pagination values from model.

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.

setPagination : Model a -> Pagination -> Model a

Set manually the table pagination values.

Configuration


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

Table's configuration (opaque).


type alias Column a msg =
Internal.Column.Column a msg

Column's configuration (opaque).

static : (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).

dynamic : (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 -> Platform.Sub.Sub msg

Table's subscriptions.