mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
fixes #429, which is yet yet another WAT of RJSONIO
perhaps we really should consider switching to jsonlite...
This commit is contained in:
3
NEWS
3
NEWS
@@ -27,6 +27,9 @@ shiny 0.9.1.9XXX
|
||||
* `sliderInput` and `selectizeInput`/`selectInput` now use a standard horizontal
|
||||
size instead of filling up all available horizontal space.
|
||||
|
||||
* Fixed a bug of renderDataTable() when the data object only has 1 row and 1
|
||||
column. (Thanks, ZJ Dai, #429)
|
||||
|
||||
shiny 0.9.1
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -606,7 +606,11 @@ dataTablesJSON <- function(data, req) {
|
||||
fdata <- data[i, , drop = FALSE] # filtered data
|
||||
} else fdata <- data
|
||||
fdata <- unname(as.matrix(fdata))
|
||||
# WAT: toJSON(list(x = matrix(nrow = 0, ncol = 1))) => {"x": } (#299)
|
||||
if (nrow(fdata) == 0) fdata <- list()
|
||||
# WAT: toJSON(list(x = matrix(1:2))) => {x: [ [1], [2] ]}, however,
|
||||
# toJSON(list(x = matrix(1))) => {x: [ 1 ]} (loss of dimension, #429)
|
||||
if (all(dim(fdata) == 1)) fdata <- list(list(fdata[1, 1]))
|
||||
|
||||
res <- toJSON(list(
|
||||
sEcho = as.integer(sEcho),
|
||||
|
||||
Reference in New Issue
Block a user