shinyjs

disabling/enabling sidebar from server side

寵の児 提交于 2019-12-17 19:46:31
问题 Is there any way to manually disabling/enabling the sidebar on shiny dashboard app from the server side? I would like to hide the sidebar automatically when I need more space without using toggle button on the header. Thank you 回答1: I'm not very familiar with dashboards as I never built one, but from a taking a quick look, it seems like when clicking on the open/hide sidebar button, all that happens is a sidebar-collapse class gets added/removed to the <body> tag. Maybe more things happen

How to manually collapse a box in shiny dashboard

十年热恋 提交于 2019-12-17 19:46:29
问题 I'm trying to collapse a box manually when something happens. It seems that I only need to add the class "collapsed-box" to the box, I tried to use the shinyjs function addClass , but I don't know how to do that becuase a box doesn't have an id . Here as simple basic code that can be used to test possible solutions: library(shinydashboard) ui <- dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( box(collapsible = TRUE,p("Test")), actionButton("bt1", "Collapse") ) ) server <-

Observe sweetalert2 confirm with javascript in R Shiny

冷暖自知 提交于 2019-12-13 20:09:15
问题 I have switched to sweetalert2 since the old version is more limited than the new version which is actively developped. I am running into a problem however, the code I used to observe confirm or cancel in the old version is not working for me anymore. In the old version I used to add a function in the ' myjava ' code after closeOnConfirm: true} namely: , evalFunction = function(isConfirm){ if (isConfirm === true) { var val1= 1; Shiny.onInputChange('option1', [val1, Math.random()]); } else {

Reset input fields of dynamically generated widgets through insertUI

非 Y 不嫁゛ 提交于 2019-12-13 03:47:13
问题 I am trying to develop a shinyapp that is part of a bigger form. In particular, for this module the users have the possibility to dynamically add (through insertUI) and remove (through removeUI) a new row with the exact same widgets of the previous one. Moreover, every new widget will contain the exact selected same choices of the widgets of the previous row, credits to Eli Berkow for having found the solution for this last functionality. Ideally, after a users submit his answer, a reset()

Shiny: How to initialize empty reactiveValues with an actionButton?

拟墨画扇 提交于 2019-12-12 19:21:42
问题 Background: In my app, I have built a pop-up modal wherein users can define variables/parameters and they're subsequently stored in a reactiveValues() once an actionButton is pressed. This appears to work fine. The problem: I have a separate actionButton which is supposed to clear/empty the reactiveValues that holds the inputs above. Unfortunately, this doesn't seem to work--that is, pressing the button doesn't do anything. Minimally-reproducible code: library(DT) # UI modules sidebarCharts <

To show fileinput and actionbutton inline

ぃ、小莉子 提交于 2019-12-11 19:17:37
问题 I am trying to build an app using R shiny where I am using fileinput and action button in same box. I am facing issues to show above two inline. Refer to below working example: library(shiny) library(shinydashboard) ui <- dashboardPage( dashboardHeader(title = "Inline Widgets Issue"), dashboardSidebar( ), dashboardBody( box(title = "Working Example",width=40 ,status = "warning", solidHeader = TRUE, collapsible = FALSE, fluidRow(column(width=8,fileInput('file1', 'Browse File',width="100%",

shinyjs - setBookmarkExclude for delay IDs

╄→尐↘猪︶ㄣ 提交于 2019-12-11 15:25:34
问题 I am attempting to exclude a ShinyJS delay from a reactive bookmarking context in Shiny. I see that the delay ID in the URL is autogenerated and always different: delay-ad190e10123bd97f960fed7a8a9e6fde=3000. I attempted to exclude the delay via regular expression, however I don't believe the regex is being parsed: setBookmarkExclude( c("delay-[[:alnum:]]")) I would like a way to either set the ID on the delay so it is the same every time or to regex the setBookmarkExclude to exclude the

download button disappear after editing data table in shiny app

蹲街弑〆低调 提交于 2019-12-11 14:29:54
问题 I have included editable table in my shiny app I developed in my organization. Use this simple example to illustrate the issue. This is an extension of this question In this app, after I edit any cell, the download button just disappear. Does anyone know why that happens? Thanks a lot in advance. library(shiny) library(DT) library(dplyr) # UI ui = fluidPage( selectInput("nrows", "select n entries", choices = 100:150, selected = 100, multiple = FALSE), downloadButton("download1", "Download

download button disappear when deselecting column or editing data table in shiny app

夙愿已清 提交于 2019-12-11 10:59:29
问题 I built a shiny app for downloading customized and editable data table. Here I use iris dataset as an example. According to this post, I add a button to download the whole dataset as csv. However, one issue came up. When I tried to uncheck some column OR edit table, the download button simply disappear. And it never show up again. I spend hours trying to figure it out but was unsuccessful. Does anyone know why that happens? Thanks a lot in advance. library(shiny) library(DT) library(dplyr) #

Can you use shinyjs to hide/show whole panels?

有些话、适合烂在心里 提交于 2019-12-11 07:37:39
问题 I'm wondering if it would be possible to use the shinyjs hide and show functions on an entire shiny wellPanel? I'm interested in doing so to conditionally show one of two panels and from what I can tell I cannot use a reactive value in the condtional for a conditionalPanel. Below is an example of what I have in mind, however I cannot figure out how to refer to the id given to the well panels in the shinyjs functions. library(shiny) library(shinyjs) ui <- fluidPage( useShinyjs(), actionButton(