我这里有一个99%工作最小化的例子。我唯一想改变的是有排名号码旁边的字母,而不是在上面的行。
library(shiny)
library(sortable)
addDiv <- function(x) {lapply(x,function(x){tags$div(x)})}
ui <- fluidPage(
tags$head(
tags$style(HTML('
#rank_list_basic > div {cursor: move; #fallback
cursor: grab; cursor: pointer;}
#rank_list_basic {list-style-type: none; counter-reset: css-counter 0;}
#rank_list_basic > div {counter-increment: css-counter 1;}
#rank_list_basic > div:before {content: counter(css-counter) ". ";}
')
)
),
fluidRow(
rank_list(
text = "Drag the items in any desired order",
labels = addDiv(c("A","B","C","D","E")),
input_id = "output",
css_id = "rank_list_basic"
),
verbatimTextOutput("results_basic")
)
)
server <- function(input, output) {
output$results_basic <- renderPrint({
input$output
})
}
shinyApp(ui, server)
1条答案
按热度按时间1zmg4dgp1#
您只需将
labels
放入list
中,而不是使用addDiv
: