Is there to way to extract the values of DT table using reacivevaluestoList in Shiny. Right now i need to get the values under DT table in json.
Is there a way to achieve this?
Right now it is displaying only ir_input values and not "ir"
library(shiny)
library(jsonlite)
library(DT)
ui <- fluidPage({
au <- read_excel("au.xlsx")
au <- as.data.frame(au)
df <- reactiveValues()
mainPanel(
dataTableOutput("ir"),
actionButton("ac", "ac")
)
})
server <- function(input, output, session) {
df$asd <- head(iris,n = 2)
observeEvent(input$ac,{
df$asd <- df$asd[-as.numeric(input$ir_rows_selected),]
})
observe({
print(reactiveValuesToList(input, all.names = F))
})
output$ir <- renderDataTable({
datatable(df$asd)
})
}
shinyApp(ui, server)