Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create multiple rows in argonTable #34

Open
CyprienCambus opened this issue Jun 15, 2022 · 0 comments
Open

Create multiple rows in argonTable #34

CyprienCambus opened this issue Jun 15, 2022 · 0 comments

Comments

@CyprienCambus
Copy link

CyprienCambus commented Jun 15, 2022

Hi everyone,

I've tried to insert many rows in argonTable and I found a solution which is the following:

  1. In a script, I format the dataframe by using this piece of code:
library(argonDash)
library(argonR)
mtcars$car <- rownames(mtcars)

paste_items <- function(row){
  paste("argonTableItems(argonTableItem('", mtcars[row,"car"],"'), argonTableItem(dataCell = TRUE,",  mtcars[row,"mpg"], "))", sep = "")
}

res <- parse(text = sapply(c(1:nrow(mtcars)), function(i) paste_items(i)))
  1. In the app.R I change the output by:
output$argonTable <- renderUI({
      
      wrap <- if (input$cardWrap == "Enable") TRUE else FALSE
      
      argonTable(
        cardWrap = wrap,
        headTitles = c(
          "CAR",
          "MPG"
        ),
        lapply(c(1:length(res)), function(i) eval(res[i]))
      )
    })

However it would be nice to have multiple pages instead of a single page. Any ideas?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant