Namespace

Datatable

Datatable

Methods

# static Datatable() → {React.ReactElement}

The main component to generate a datatable. Contains a check for the validity of the headings and data props (do not return anything in case of invalidity).
Parameters:
Name Type Description
props.headings array mandatory, used to build the column headers, have to be in the form of an array of objects with the shape being {key:string, label:string, type: string, format: function||string} (format is optionnal, key must be unique in array)
props.data array mandatory, used to build the data ro of the table, have to be an array of object with the shape being {key1:value, key2:value, ...} only the keys matching a key in headings will be displayed. Can be an empty array if there is no data to display
props.className string an optionnal list of space separated classes to be applied to the datatable wrapper.
props.itemsPerPageOption array an optionnal list of the available values for the number of items to display per page. Default is [10, 25, 50, 100]
props.isScrollable boolean an optionnal value to stand if the column not being displayed within the screen should be get by horizontal scroll (true) or by clicking on a row to expand missing value (false). Default value is false.
props.style object an optionnal set of style rules to choose between a predefined list to override existing rules. Default is {}

View Source index.tsx, line 24

jsx to be injected in the html
React.ReactElement