shinycustomloader icon indicating copy to clipboard operation
shinycustomloader copied to clipboard

Display the loader after clicking actionButton until the datatable has loaded

Open KKulma opened this issue 6 years ago • 1 comments

It's not really an issue, but specific application question.

I have an app where a user chooses a file name from a drop-down menu (selectizeInput) and confirms the choice with an actionButton. The app will display the results in the DT::dataTableOutput format.

I'd like to be able to show a loading screen (using shinydashboardloader package) but only AFTER a user presses the actionButton. Prior that I'd like to show an empty screen. Additionally, if a user wants to try several files in one session, the loading screen should appear every time the actionButton has been pressed and disappear when the dataset has been loaded.

If I simply use

dashboardBody(
    fluidRow(
      box(h2("My Data"),
      div(style = 'overflow-x: scroll', 
          withLoader(DT::dataTableOutput('mytable'),
                     type = "html",
                     loader = "loader1")),
      width = 12)

  )
  )

The loader appears before the actionButton is pressed and doesn't appear when a user wants to load second, third, etc. file as there's already an output in the main panel from the previous process. I asked the same question on StackOverflow, got some useful pointers, but I'm not sure if they are relevant to shinycustomloader.

Hope it all makes sense but let me know if not!

KKulma avatar May 29 '18 14:05 KKulma

Sorry I did not realise there were issues open. I will look into this.

emitanaka avatar Jun 24 '18 05:06 emitanaka