Scout/Concepts/Table
A table is data structure that can be represented in a TablePage or a TableField.
Contents
Description
Table can contains a set of structured data: the structure of the entity is defined by the columns. Each entity contained in the table is a row. At the intersection of a column and a row is a Cell. A Cell describes how the value is represented (displayed text, colors, style, icon...).
Example
magine the you want to represent Persons that are structured as followed:
- Name (String)
- First name (String)
- Age (Integer)
- Date of birth (Date)
A such table needs to contains 4 columns :
- NameColumn a String Column
- FirstNameColumn a String Column
- AgeColumn a Integer Column
- BirthColumn a Date Column
Access to the data
To access a value of a table, the common pattern is to go throw the column. For example if you want to access the age of a person, at a precise row index r, the code is:
private Integer getAgeOfPersonAtRow(int r){ return getTable().getAgeColumn().getValue(r); }
TODO
Load the data
in the page or in the field
add row
Display/Hide the data
Table provides support to sort, to filter how the content is represented.
Selection
Table also manages selection.
properties
Menu
Table can also contains Menus, to provide a possibility to trigger some actions (Menus are displayed in the context menu of the table).