Open sschw56 opened 3 years ago
Nobody?
Probably far too late to be useful, but here's an example modified slightly from this post that outputs user-manipulated table data (i.e. when the row moves, the output data moves):
library(shiny)
library(rhandsontable)
ui <- fluidPage(
titlePanel("rhandsontable test"),
mainPanel(
rHandsontableOutput("test"),
p(),
h3('Reactivity check'),
verbatimTextOutput("content")
)
)
server <- function(input, output) {
output$test <- renderRHandsontable({
rhandsontable(
data = iris[1:5,],
manualRowMove = TRUE,
manualColumnMove = TRUE
)
})
output$content <- renderText({
tmp <- hot_to_r(input$test)
sprintf(
'Column names: %s\nRow names:%s',
paste(names(tmp), collapse = ', '),
paste(tmp$Sepal.Length, collapse = ', ')
)
})
}
shinyApp(ui = ui, server = server)
Hi there,
I am developing a R Shiny App, using a RHandsontable. In the table it should be possible to move the rows via click and drop. So I set manualRowMove = TRUE and it works. My problem ist now, how do I get the current shown table (after the row moving)?
I poorly can JavaScript (and that is here the main problem), but I guess I need the "afterRowMove" hook. How do I get a reactive information, when the user moves a row? Or, it dont has to be reactive, because I added a own context menu item and if this item is triggered, then I need to know which row of the table is where (the index doesn't work!).
Please help me. I read a lot about hooks and Handsontable, but everything is in JS and I cann't transfer it into R.
Chefkoch
Here is a small example: