integrate a data table into a nested menu

Plz, help me! How can I integrate the 1st code to the 2nd one in the following example? As a result I want it to run in shiny and display as a data table.

#The 1st code snippet:

data_table <- data.table(

"No" = c(1, 2, 3, 4, 5),

"Date" = as.Date(c("2021-01-01", "2021-01-02", "2021-01-03", "2021-01-04", "2021-01-05")),

"Primary_Document_Number" = c("A001", "A002", "A003", "A004", "A005"),

)

#The 2nd code snippet:

Accounting <- list(
  Short_Term_Assets = list(
    name = "Short Term Assets",
    items = list(
      Cash = list(
        name = "Cash",
        items = list(
          Cash_in_account = list(name = "Cash in account")
        )
      )
    )
  )
)


ui <- fluidPage(
  br(),
  NestedMenuOutput("menu", height = "auto"),
  br(),
  dataTableOutput("clicked")
)

server <- function(input, output, session) {
  output[["menu"]] <- renderNestedMenu({
    NestedMenu(

      "Accounting",
      items = Accounting
    )
  })

  output[["clicked"]] <- renderDataTable({
    input[["menu"]]
  })
}

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.