module Row_id = Row_idmodule Column_id = Column_idThis isn't just an int so that if an app adds columns the sort is maintained properly by the app's own classification instead of index. But it can be an int.
module Sort_spec = Sort_specmodule Sort_key = Sort_spec.Sort_keymodule Sort_dir = Sort_spec.Sort_dirmodule Sort_criteria : sig ... endA 'a Sort_criteria.t specifies a list of columns by which to sort the rows of a
table, in order of precedence from highest to lowest. Each column's sort criteria is
made up of a direction and a value of type 'a, which varies as the sort criteria
goes through several rounds of processing.
module Base_sort_criteria : sig ... endmodule Html_id : sig ... endmodule Column : sig ... endmodule Key : sig ... endThis is the key used for sorting functionality. Apps don't need to touch this to use this widget, it is only exposed in case apps need to do something involving sorting in the same way as the table will.
module Model : sig ... endmodule Derived_model : sig ... endmodule Action : sig ... endval current_key : _ Derived_model.t ‑> row_id:Row_id.t ‑> Key.t optioncurrent_key d row_id returns row_id's Key.t associated with the current sort
criteria of d. Returns None if row_id does not exist in d
Functions scroll_*_into_scroll_region and scroll_*_to_position will always work if
the row heights in the model are correct (either because the row height estimate is
correct for all rows, or because all rows have already been rendered and measured).
If the row heights in the model are off, it may take multiple iterations of calling
the scroll function and then remeasuring row heights in update_visibility before
the specified element is successfully scrolled to its target.
val scroll_row_into_scroll_region : Model.t ‑> _ Derived_model.t ‑> Row_id.t ‑> Table_intf.Scroll_result.tval scroll_col_into_scroll_region : Model.t ‑> _ Derived_model.t ‑> Column_id.t ‑> Table_intf.Scroll_result.tval scroll_focus_into_scroll_region : Model.t ‑> _ Derived_model.t ‑> Table_intf.Scroll_result.tval scroll_row_to_position : ?keep_in_scroll_region:unit ‑> Model.t ‑> _ Derived_model.t ‑> Row_id.t ‑> position:float ‑> Table_intf.Scroll_result.tval scroll_col_to_position : ?keep_in_scroll_region:unit ‑> Model.t ‑> _ Derived_model.t ‑> Column_id.t ‑> position:float ‑> Table_intf.Scroll_result.tval scroll_focus_to_position : ?keep_in_scroll_region:unit ‑> Model.t ‑> _ Derived_model.t ‑> position:(float * float) ‑> Table_intf.Scroll_result.tFunctions *_is_in_scroll_region and get_*_position return None if the
specified element is not found (e.g. there is no focus, or there is no row/column
with the given id), or if the visibility measurements are not yet available.
By default, the model's scroll margin is used to compute the bounds of the scroll
region. However, if a scroll_margin argument is given, that will be use instead.
val row_is_in_scroll_region : ?scroll_margin:Table_intf.Margin.t ‑> Model.t ‑> _ Derived_model.t ‑> Row_id.t ‑> bool optionval col_is_in_scroll_region : ?scroll_margin:Table_intf.Margin.t ‑> Model.t ‑> _ Derived_model.t ‑> Column_id.t ‑> bool optionval focus_is_in_scroll_region : ?scroll_margin:Table_intf.Margin.t ‑> Model.t ‑> _ Derived_model.t ‑> bool optionval get_row_position : _ Derived_model.t ‑> Row_id.t ‑> float optionval get_col_position : Model.t ‑> _ Derived_model.t ‑> Column_id.t ‑> float optionval get_focus_position : Model.t ‑> _ Derived_model.t ‑> float option * float optionval get_focus_rect : Model.t ‑> _ Derived_model.t ‑> float Incr_dom_widgets__.Import.Js_misc.Rect.t optionReturns the bounding client rectangle of the currently focused cell, if any. This only returns a value if both the focus row and focus column are set.
val find_row_by_position : Model.t ‑> _ Derived_model.t ‑> float ‑> [ `Before | `At of Row_id.t | `After ] optionFinds the row id at a given vertical position on the page, or indicates that the
position is before/after all the rows in the table.
It only returns None if the model has no visibility info.
val find_col_by_position : Model.t ‑> _ Derived_model.t ‑> float ‑> [ `Before | `At of Column_id.t | `After ] optionFinds the column id at a given horizontal position on the page, or indicates that
the position is before/after all the columns in the table.
It only returns None if the model has no visibility info or if a call to
Dom_html.getElementById_opt on a header cell id returns None.
val on_display : old:Model.t ‑> Model.t ‑> _ Derived_model.t ‑> unitUsed for scrolling to rows/columns upon focusing them
val apply_action : Model.t ‑> _ Derived_model.t ‑> Action.t ‑> Model.tUsed to handle sort column clicking
val set_focus_col : Model.t ‑> Column_id.t option ‑> Model.ttype 'a row_renderer = row_id:Row_id.t ‑> row:'a Incr_dom_widgets__.Import.Incr.t ‑> Row_node_spec.t Incr_dom_widgets__.Import.Incr.tWhen constructing the row Vdom.Node.t (most likely using function Vdom.Node.tr),
it is important to pass in the argument ~key:id. Otherwise scrolling may have
unexpected behavior.
val view : ?override_header_on_click:(Column_id.t ‑> Incr_dom_widgets__.Import.Dom_html.mouseEvent Incr_dom_widgets__.Import.Js.t ‑> Incr_dom_widgets__.Import.Vdom.Event.t) ‑> Model.t Incr_dom_widgets__.Import.Incr.t ‑> 'a Derived_model.t Incr_dom_widgets__.Import.Incr.t ‑> render_row:'a row_renderer ‑> inject:(Action.t ‑> Incr_dom_widgets__.Import.Vdom.Event.t) ‑> attrs:Incr_dom_widgets__.Import.Vdom.Attr.t list ‑> Incr_dom_widgets__.Import.Vdom.Node.t Incr_dom_widgets__.Import.Incr.tReturns a full partially-rendered <table> node with header. render_row function
should render <tr> nodes.