Skip to content

Commit

Permalink
Address changes to Handsontable
Browse files Browse the repository at this point in the history
Support licenseKey for new license model of Handsontable
Address height and width issue with new Handsontable

Handsontable version 7.0.0 changes the license model.
https://github.com/handsontable/handsontable/releases/tag/7.0.0
  • Loading branch information
trshafer committed Jul 28, 2019
1 parent 2cb351c commit 916fe8c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion R/rhandsontable.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' will be used. Setting to \code{NULL} will omit.
#' @param rowHeaders a vector of row names. If missing \code{rownames}
#' will be used. Setting to \code{NULL} will omit.
#' @param licenseKey the license key to pass to Handsontable
#' @param comments matrix or data.frame of comments; NA values are ignored
#' @param useTypes logical specifying whether column classes should be mapped to
#' equivalent Javascript types. Note that
Expand All @@ -34,7 +35,7 @@
#' rhandsontable(DF, rowHeaders = NULL)
#' @seealso \code{\link{hot_table}}, \code{\link{hot_cols}}, \code{\link{hot_rows}}, \code{\link{hot_cell}}
#' @export
rhandsontable <- function(data, colHeaders, rowHeaders, comments = NULL,
rhandsontable <- function(data, colHeaders, rowHeaders, licenseKey = NULL, comments = NULL,
useTypes = TRUE, readOnly = NULL,
selectCallback = FALSE,
width = NULL, height = NULL, digits = 4,
Expand Down Expand Up @@ -128,6 +129,7 @@ rhandsontable <- function(data, colHeaders, rowHeaders, comments = NULL,
columns = cols,
width = width,
height = height,
licenseKey = licenseKey,
debug = ifelse(is.null(debug) || is.na(debug) || !is.numeric(debug), 0, debug),
search = search
)
Expand Down
7 changes: 7 additions & 0 deletions inst/htmlwidgets/rhandsontable.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ HTMLWidgets.widget({

//this.afterRender(x);

if (x.height == null) {
x.height = 'auto';
}
if (x.width == null) {
x.width = 'auto';
}

this.params = x;

if (instance.hot) { // update existing instance
Expand Down
4 changes: 3 additions & 1 deletion man/rhandsontable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 916fe8c

Please sign in to comment.