My DT datatable has a banner covering it that says "Processing..." even though the data table has been processed and the data is appearing behind the banner. The banner won't DISAPPEAR and it's making me nuts.
Certain users of my App WANT the column-specific search functionality of the deprecated shiny::renderDataTable() so I am running the shiny::renderDataTable() for data.frames on some tabs, and the DT::renderDataTable() on other tabs.
I'm using R-Portable (Windows 7) because the app needed to be deployable to relevant stakeholders on the floor... so unless you're using R-Portable, I don't believe you'll fully reproduce the environment I'm running... but this seems like an AJAX problem, so maybe someone with insight can give an answer without "reproducing" the error. Besides, there's at least 1500 lines of code in this Shiny App, so I'm pulling out what I can to elucidate the question without leaving too much confusion.
Everything works flawlessly in my app in terms of functionality... and I'm using all of the following packages including shinyBS (bootstrap) and shinythemes, setting all major functions into the global.R file:
library(shiny)
library(shinyBS)
library(shinythemes)
library(RODBC)
library(ggplot2)
library(gridExtra)
library(Hmisc)
library(stringr)
library(data.table)
library(DT)
I create my reactive data table object with a function that calls from our SQL databases using RODBC... I've got an action button, a text input, and the reactive() script calls the function AttrInfo() which returns a data.frame.
TriInfo = reactive({
input$UpdateTBAtt
if(input$UpdateTBAtt == 0) return(NULL)
isolate(withProgress(message = "Searching for Credit Attribute",
value = 0, {
AttrInfo(input$TriAttr)
}))
})
My code for rendering the data table is following the DT guide:
output$TriLDD <- DT::renderDataTable({
req(input$UpdateTBAtt)
DT::datatable(TriInfo(),options = list(paging=FALSE,searching=FALSE))
})
My ui.R file calls this object:
shinyUI(fluidPage(
list(tags$head(HTML('<link rel="icon", href="RosiePageICON.png",
type="image/png" />'))),
div(style="padding: 1px 0px; width: '100%'",
titlePanel(title="", windowTitle="Rosetta")),
navbarPage(theme = shinytheme("spacelab"),title = div(img(src="ReadyRosie_Logo6.png"),""),
tabPanel("Tri-Bureau Attributes",
sidebarLayout(
sidebarPanel(width = 3,
actionButton(inputId = "UpdateTBAtt",label = "Get Attribute"),
textInput("TriAttr","Credit Attribute:", value = "")),
mainPanel(width=9,
tabsetPanel(id = "TB",
tabPanel(title = "Check Tables",
p("Here's the Definition:"),
dataTableOutput(outputId = "TriLDD")))))))))
So I finally found the workaround buried in the jQuery library... sometimes it doesn't require reproducible code if the answer is a simple option...
In general, something in the jQuery processing of the DT library when the shiny::renderDataTable command is also sourced in the same app, this is causing the issue. Anyway, I found a simple workaraound.
I went to the dataTables jQuery page and found the "processing" option... I just added it to the options:
DT::datatable(TriInfo(),options = list(paging=FALSE, searching=FALSE, processing=FALSE))
and it finally disappeared.
This can occur if shiny thinks you're using shiny::dataTableOutput()
instead of DT::dataTableOutput()
.
If you explicitly use DT::renderDataTable()
and DT::dataTableOutput()
in your server and ui you will avoid this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With