package bonsai

  1. Overview
  2. Docs
A library for building dynamic webapps, using Js_of_ocaml

Install

Dune Dependency

Authors

Maintainers

Sources

bonsai-v0.16.0.tar.gz
sha256=1d68aab713659951eba5b85f21d6f9382e0efa8579a02c3be65d9071c6e86303

doc/bonsai.web_ui_view/Bonsai_web_ui_view/Table/Col/index.html

Module Table.ColSource

Sourcetype 'a t

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.

Sourceval 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.

Sourceval 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

Sourceval group : ?header_attr:Virtual_dom.Vdom.Attr.t -> string -> 'a t list -> 'a t

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

Sourceval lift : 'a t -> f:('b -> 'a) -> 'b t

The remaining "prime" functions in this module are identical to their "non-prime" versions except that the "label" argument is an arbitrary Vdom node.

Sourceval 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
Sourceval group' : ?header_attr:Virtual_dom.Vdom.Attr.t -> Virtual_dom.Vdom.Node.t -> 'a t list -> 'a t
Sourceval 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
OCaml

Innovation. Community. Security.