mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
add documentation for column customization
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
+ [TableView](../frontend/src/components/TableView/TableView.tsx) is a generic component that takes in column definitions, data, and renders a [material-react-table (click for docs)](https://www.material-react-table.com/). It also handles the tables state management: for example saving column filters into url, and restoring them on first render.
|
||||
|
||||
+ Each table have their columns defined in the components own file. For example the columns of Cross-search table are defined in frontend/src/components/CrossSearch/CrossSearchTable.tsx in the variable columns. The simplest definition is to give the column an accessorKey (to access the correct data) and a header. By default, columns are visible. User can toggle the visibility on/off via the interface. Column can be also hidden by default. For this it needs an id in addition to accessorKey and header. Each table also has a variable 'visibleColumns', in which columns can be referenced by their id and set 'false' to be hidden by default.
|
||||
|
||||
+ [DetailView](../frontend/src/components/DetailView/)-folder has components that are used by the detailed view: The view which allows looking at and editing a single data item, for example a locality. The DetailView-component is generic, allowing different data types to use it.
|
||||
|
||||
**Example of a detail view rendering tree**
|
||||
|
||||
Reference in New Issue
Block a user