package bonsai
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=1d68aab713659951eba5b85f21d6f9382e0efa8579a02c3be65d9071c6e86303
doc/bonsai.web_ui_view/Bonsai_web_ui_view/Table/Col/index.html
Module Table.Col
Source
A 'a Col.t
represents a column (or set of columns) that defines a way to render cells from a row in the table that has type 'a
.
val make :
?cell_attr:('b -> Virtual_dom.Vdom.Attr.t) ->
?header_attr:Virtual_dom.Vdom.Attr.t ->
string ->
get:('a -> 'b) ->
render:(Theme.t -> 'b -> Virtual_dom.Vdom.Node.t) ->
'a t
make
builds a column for a row 'a
by providing a getter 'a -> 'b
and a renderer for the 'b
. The first parameter is a string that is used for the label of the column.
header_attr
is an optional attribute attached to the <th> element containing the label.
cell_attr
is for building attribute that will be attached to the <td> element containing the rendered content of the cell.
val make_opt :
?cell_attr:('b -> Virtual_dom.Vdom.Attr.t) ->
?header_attr:Virtual_dom.Vdom.Attr.t ->
string ->
get:('a -> 'b option) ->
render:(Theme.t -> 'b -> Virtual_dom.Vdom.Node.t) ->
'a t
make_opt
is the same as make
except that the return value from get
can be an option
group
produces a column group over the provided list of columns with the string parameter being used as the label for the group.
header_attr
behaves the same as it does for the make
function
The remaining "prime" functions in this module are identical to their "non-prime" versions except that the "label" argument is an arbitrary Vdom node.
val make' :
?cell_attr:('b -> Virtual_dom.Vdom.Attr.t) ->
?header_attr:Virtual_dom.Vdom.Attr.t ->
Virtual_dom.Vdom.Node.t ->
get:('a -> 'b) ->
render:(Theme.t -> 'b -> Virtual_dom.Vdom.Node.t) ->
'a t
val group' :
?header_attr:Virtual_dom.Vdom.Attr.t ->
Virtual_dom.Vdom.Node.t ->
'a t list ->
'a t
val make_opt' :
?cell_attr:('b -> Virtual_dom.Vdom.Attr.t) ->
?header_attr:Virtual_dom.Vdom.Attr.t ->
Virtual_dom.Vdom.Node.t ->
get:('a -> 'b option) ->
render:(Theme.t -> 'b -> Virtual_dom.Vdom.Node.t) ->
'a t