Skip to content

Commit

Permalink
Fixes #88
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Owen committed Jul 5, 2016
1 parent 530b574 commit d5c2b1b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ rhandsontable 0.3.2

* Added rowHeaderWidth to hot_table to allow specifying the rowHeader column width

* Added digits to rhandsontable, which is passed to jsonlite::toJSON

* Fixed shiny bug with mixed numeric and character column names (#77)

rhandsontable 0.3.1
Expand Down
8 changes: 5 additions & 3 deletions R/rhandsontable.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#' This can be used with shiny to tie updates to a selected table cell.
#' @param width numeric table width
#' @param height numeric table height
#' @param digits numeric passed to \code{jsonlite::toJSON}
#' @param ... passed to hot_table
#' @examples
#' library(rhandsontable)
Expand All @@ -32,7 +33,7 @@
rhandsontable <- function(data, colHeaders, rowHeaders, comments = NULL,
useTypes = TRUE, readOnly = NULL,
selectCallback = FALSE,
width = NULL, height = NULL, ...) {
width = NULL, height = NULL, digits = 4, ...) {
if (missing(colHeaders))
colHeaders = colnames(data)
if (missing(rowHeaders))
Expand Down Expand Up @@ -101,7 +102,8 @@ rhandsontable <- function(data, colHeaders, rowHeaders, comments = NULL,
}

x = list(
data = jsonlite::toJSON(data, na = "string", rownames = FALSE),
data = jsonlite::toJSON(data, na = "string", rownames = FALSE,
digits = digits),
rClass = rClass,
rColClasses = rColClasses,
rColnames = as.list(colnames(data)),
Expand Down Expand Up @@ -186,7 +188,7 @@ hot_table = function(hot, contextMenu = TRUE, stretchH = "none",
if (!is.null(customBorders)) hot$x$customBorders = customBorders
if (!is.null(enableComments)) hot$x$comments = enableComments
if (!is.null(overflow)) hot$x$overflow = overflow
if (!is.null(rowHeaderWidth)) hot$x$rowHeaderWidth = rowHeaderWidth
if (!is.null(rowHeaderWidth)) hot$x$rowHeaderWidth = rowHeaderWidth

if ((!is.null(highlightRow) && highlightRow) ||
(!is.null(highlightCol) && highlightCol))
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 d5c2b1b

Please sign in to comment.