Closed emantzo closed 3 years ago
Hi I was wondering how it is possible to use Esquisse as a Tabset in an app, like this :
library(shiny) library(DT) library(writexl) ui <- fluidPage( titlePanel("CARS"), mainPanel( tabsetPanel(type = "tabs", tabPanel( id = "dataset", tabPanel( "Cars Bank", DT::dataTableOutput("banking.df_data"), br(), actionButton("saveBtn", "Save"), br(), DT::dataTableOutput("updated.df") ) ), tabPanel( esquisserUI( id = "esquisse", header = FALSE, # dont display gadget title choose_data = FALSE, # dont display button to change data, container = esquisseContainer(height = "700px") ) ) ) ) ) server <- function(input, output) { d1 <- data.frame(cars) output$banking.df_data <- renderDataTable( d1, selection = "none", editable = TRUE, rownames = TRUE, extensions = "Buttons", options = list( paging = TRUE, searching = TRUE, fixedColumns = TRUE, autoWidth = TRUE, ordering = TRUE, dom = "Bfrtip", buttons = c("csv", "excel") ), class = "display" ) observeEvent(input$banking.df_data_cell_edit, { d1[input$banking.df_data_cell_edit$row, input$banking.df_data_cell_edit$col] <<- input$banking.df_data_cell_edit$value }) observeEvent(input$saveBtn, { write_xlsx(d1, "test3.xlsx") }) } shinyApp(ui = ui, server = server)
seems I had forgotten line: title = "esquisse", before esquisserUI(
title = "esquisse",
esquisserUI(
Works fine now!
Hi I was wondering how it is possible to use Esquisse as a Tabset in an app, like this :