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.
tableId
is a unique name you give to the grid;step
is the step where the table will be, created withrpgm.step()
;widgetId
is the id of the label widget that will contain the table;height
is the height of the grid in pixels;options
is 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
height
option of Handsontable will be automatically set to theheight
parameter of the function; - If the
rowHeaders
is set toTRUE
, it will be replaced by the row names of the data frame; - If the
colHeaders
is set toTRUE
, it will be replaced by the columns names of the data frame; - If no
columns
option are set, the module will automatically call theHandsontable.getColumnsFromDF
function 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.