Package dev. fritz2. components. datatable
Types
This alias expresses the grouping of a Column paired with its sorting strategy. Together with the SortingPlan this represents the foundation of the sorting mechanisms: Based upon the SortingPlan this plan is created from the given Columns of a datatable and is then used to do the actual sorting within a RowSorter implementation.
There are three different interfaces on that the separate sorting functionalities are implemented:
SortingPlanReducer: create a plan of columns to be sorted in a specific direction based upon the former plan and the triggering user action
RowSorter: do the actual sorting work based upon the above plan (slightly transformed to typed column instead of plain ids)
SortingRenderer: render the appropriate UI for the sorting actions in the header columns
Here is the big picture visualized:
+-----------------------------------------------------------------+
| (emits new state) |
| |
v |
+------------------------------------------+ |
| State | |
+------------------------------------------+ |
| val sortingPlan: SortingPlan | |
+------------------------------------------+ |
| fun columnSortingPlan: ColumnSortingPlan | |
+------------------------------------------+ |
^ |
| +----------------------------------+ |
User action as input: |(owns) +---->| SortingPlanReducer (1) |---+
(Column ID+Strategy) | | +----------------------------------+
| | | | Creates a new SortingPlan based |
| +-----------------------------+ | | upon the former plan, the newly |
| | StateStore | | | column ID and its sorting |
| +-----------------------------+ | | strategy (asc, desc, none) |
+---->| val sortingChanged: Handler |-----+ +----------------------------------+
+-----------------------------+
+---->| fun renderingRowsData |-----+
| +-----------------------------+ | +----------------------------------+
| +---->| RowSorter (2) |
| +----------------------------------+
| | Takes the current rows and sort |
TableComponent | them according to the column |
.renderRows() | based sorting plan. |
| So the raw ``sortingPlan`` |
| field of the state object must |
| be enriched before with the |
| actual ``Column`` objects by |
| the ``columnSoftingPlan`` |
| function. |
+----------------------------------+
+----------------------------------+
TableComponent ------------------------------------>| SortingRenderer (3) |
.renderHeader() +----------------------------------+
| Renders the UI elements |
| (icons eg.) for configuring |
| and changing the sorting state. |
+----------------------------------+
[Edit](https://textik.com/#f3fc13858b89df9b)
This alias expresses the sorting plan, which is the ordered list of column ids paired with their strategies. This is the base concept for the sorting held within a State object and used for the SortingRenderer in order to create a new plan based upon user interaction (change the direction, change the column to be sorted)
There are three different interfaces on that the separate sorting functionalities are implemented:
SortingPlanReducer: create a plan of columns to be sorted in a specific direction based upon the former plan and the triggering user action
RowSorter: do the actual sorting work based upon the above plan (slightly transformed to typed column instead of plain ids)
SortingRenderer: render the appropriate UI for the sorting actions in the header columns
Here is the big picture visualized:
+-----------------------------------------------------------------+
| (emits new state) |
| |
v |
+------------------------------------------+ |
| State | |
+------------------------------------------+ |
| val sortingPlan: SortingPlan | |
+------------------------------------------+ |
| fun columnSortingPlan: ColumnSortingPlan | |
+------------------------------------------+ |
^ |
| +----------------------------------+ |
User action as input: |(owns) +---->| SortingPlanReducer (1) |---+
(Column ID+Strategy) | | +----------------------------------+
| | | | Creates a new SortingPlan based |
| +-----------------------------+ | | upon the former plan, the newly |
| | StateStore | | | column ID and its sorting |
| +-----------------------------+ | | strategy (asc, desc, none) |
+---->| val sortingChanged: Handler |-----+ +----------------------------------+
+-----------------------------+
+---->| fun renderingRowsData |-----+
| +-----------------------------+ | +----------------------------------+
| +---->| RowSorter (2) |
| +----------------------------------+
| | Takes the current rows and sort |
TableComponent | them according to the column |
.renderRows() | based sorting plan. |
| So the raw ``sortingPlan`` |
| field of the state object must |
| be enriched before with the |
| actual ``Column`` objects by |
| the ``columnSoftingPlan`` |
| function. |
+----------------------------------+
+----------------------------------+
TableComponent ------------------------------------>| SortingRenderer (3) |
.renderHeader() +----------------------------------+
| Renders the UI elements |
| (icons eg.) for configuring |
| and changing the sorting state. |
+----------------------------------+
[Edit](https://textik.com/#f3fc13858b89df9b)