Для блестящего приложения я бы хотел go по фрейму данных построчно выделить и выделить (жирным, цветным или похожим) выбранную строку в renderTable
. Я думал о выборе строки по индексу. Могу ли я сделать это с renderTable
, или я должен рассмотреть DT
?
library(shiny)
ui <-
fluidRow(
actionButton(
"my_button",
"Go to next row"
),
tableOutput("my_table")
)
server <- function(input, output){
values <- reactiveValues()
values$index <- 1
values$dat <- iris
observeEvent(
input$my_button, {
values$index <- values$index + 1
})
output$my_table <-
renderTable(values$dat) # somehow highlight the row at the index
}
shinyApp(ui = ui, server = server)