Legend:
Library
Module
Module type
Parameter
Class
Class type
Used to expose some extra information about a component that's useful for applications that need more control over scrolling, sorting and focus management.
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_focus_to_position :
?keep_in_scroll_region:unit ->Model.t->_t->position:(float * float)->Util.Scroll_result.t
Functions *_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 focus_is_in_scroll_region :
?scroll_margin:Util.Margin.t->Model.t->_t->bool option
val get_focus_position : Model.t->_t->float option * float option
Returns 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->_t->float ->[ `Before | `At of Row_id.t| `After ] option
Finds 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->_t->float ->[ `Before | `At of Column_id.t| `After ] option
Finds 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.
Returns the vertical position one page away from the current focus (above for dir
= Prev or below for dir = Next). This can be used to implementing a page_focus_row function in multi-table pages. Note that the position returned is relative to the top of the page, not the top of the table.