Handsontable module methods
In the following functions, tableId always refers to the unique id of a single table in the GUI, as defined in the Handsontable.create function with the tableId parameter.
Handsontable.create
Create a new table widget. This function must be called before entering the GUI containing the table.
- tableIdis a unique name you give to the grid;
- stepis the step where the table will be, created with- rpgm.step();
- widgetIdis the id of the label widget that will contain the table;
- heightis the height of the grid in pixels;
- optionsis the table options as defined by the Handsontable parameters.
Please note that the module only accept a data frame with the data option with some additionnal checks and option setup:
- The heightoption of Handsontable will be automatically set to theheightparameter of the function;
- If the rowHeadersis set toTRUE, it will be replaced by the row names of the data frame;
- If the colHeadersis set toTRUE, it will be replaced by the columns names of the data frame;
- If no columnsoption are set, the module will automatically call theHandsontable.getColumnsFromDFfunction to generate this option.
Handsontable.getColumnsFromDF
Return a list of column object to use with the columns option of Handonstable. If columns is not specified, the module
automatically call this function on the data frame for the columns option.
See here for the option and
here for cell types.
Handsontable.injectRowNames
Extract the row names from a data frame and add them to a new column as the first column of the df, named columnName.
This function is for convenient changing a data frame because Handonstable does not allow modifying row names, and do not correctly work with sorting and custom row names.
Handsontable.on
Add a new event listener. See the Events section for more information.
Handsontable.off
Remove an existing event listener. See the Events section for more information.
Handsontable.update
Update the settings and data of a table by overwriting its options.