-
Notifications
You must be signed in to change notification settings - Fork 80
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
Compatibility with shinyWidgets pickerInput #12
Comments
Do you have the latest version of shinyWidgets? |
Yes, I have the latest version of shinyWidgets 0.4.3 (CRAN, not github devel). |
I realized that when I translated the app of @dreamRs: So I keep it open until there is a solution |
Hi there! This works for me with library(shiny)
library(shinyWidgets)
library(bs4Dash)
ui <- bs4DashPage(
navbar = bs4DashNavbar(),
sidebar = bs4DashSidebar(),
body = bs4DashBody(
bs4TabItems(
bs4TabItem(
tabName = "test",
fluidRow(
column(
width = 6,
pickerInput(
inputId = "p1",
label = "Select all option",
choices = rownames(mtcars),
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
verbatimTextOutput(outputId = "res")
)
)
)
)
)
)
server <- function(input, output, session) {
output$res <- renderPrint(input$p1)
}
shinyApp(ui = ui, server = server) Victor PS: David this works with ratp-traffic application too. |
Hi Victor! working demo here: http://130.60.24.205/dreamRs_ratp/ |
Top David! Victor |
I use |
Wouah, that was fast !! Can I close the issue now ? |
Hi @DivadNojnarg and @pvictor, Thanks a lot for developing Despite the fix above, I still have an issue with It’s annoying when I have multiple selection enabled and a lot of inputs because I would like to set I understand that Thank you in advance, library(shiny)
library(bs4Dash)
library(shinydashboard)
library(shinyWidgets)
ui_bs4Dash <- bs4DashPage(
navbar = bs4DashNavbar(),
sidebar = bs4DashSidebar(),
body = bs4DashBody(
bs4TabItems(
bs4TabItem(
tabName = "test",
fluidRow(
column(
width = 6,
pickerInput(
inputId = "p1",
label = "Select all option",
choices = rownames(mtcars),
multiple = TRUE,
options = pickerOptions(
actionsBox = TRUE,
selectedTextFormat = "count > 3",
countSelectedText = "{0} cars selected",
showTick = TRUE
)
),
verbatimTextOutput(outputId = "res")
)
)
)
)
)
)
ui_shinydashboard <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard"))
)),
dashboardBody(
tabItems(
tabItem(
"dashboard",
fluidRow(
column(
width = 6,
pickerInput(
inputId = "p1",
label = "Select all option",
choices = rownames(mtcars),
multiple = TRUE,
options = pickerOptions(
actionsBox = TRUE,
selectedTextFormat = "count > 3",
countSelectedText = "{0} cars selected",
showTick = TRUE
)
),
verbatimTextOutput(outputId = "res")
)
)
)
)
)
)
server <- function(input, output, session) {
output$res <- renderPrint(input$p1)
}
# showTick doesn't work with bs4Dash
shinyApp(ui = ui_bs4Dash, server = server)
# showTick works with shinydashboard
shinyApp(ui = ui_shinydashboard, server = server)
My R session info (I'm using the dev versions of
|
My guess is that the glyph icons dependency is not setup in bs4Dash. I will try to fix it by the way |
And the good new is that it works with the old bootstrap 3 CSS: devtools::install_github("RinteRface/bs4Dash") library(shiny)
library(bs4Dash)
library(shinyWidgets)
server <- function(input, output, session) {
output$res <- renderPrint(input$p1)
}
ui_bs4Dash <- bs4DashPage(
navbar = bs4DashNavbar(),
sidebar = bs4DashSidebar(),
body = bs4DashBody(
bs4TabItems(
bs4TabItem(
tabName = "test",
fluidRow(
column(
width = 6,
pickerInput(
inputId = "p1",
label = "Select all option",
choices = rownames(mtcars),
multiple = TRUE,
options = pickerOptions(
actionsBox = TRUE,
selectedTextFormat = "count > 3",
countSelectedText = "{0} cars selected",
showTick = TRUE
)
),
verbatimTextOutput(outputId = "res")
)
)
)
)
)
)
# showTick doesn't work with bs4Dash
shinyApp(ui = ui_bs4Dash, server = server) |
Awesome! Thank you David, it works all fine with the latest dev version of bs4Dash. |
I'm glad I found this issue, only I wish I had found it sooner! I was running the |
Unfortunately i am still having trouble with this issue. I have tried installing the dev version of
If it is of any help, here is my session info:
|
I have the same issue and I decided that I would not move from Shinydashboard to bs4Dash for this reason now. It would be annoying for the users that they cannot see what they select with the pickerinput filters.. And select all / deselect all is only available here.. |
@thomasthomasth and @prehi12: Can you try to download bs4Dash from this: devtools::install_github("RinteRface/bs4Dash", ref = "d2dac17c7f08b99d016fde5ae13c53131c1e4d23") I guess this is coming from the bootstrap 4.3.1 update @pvictor: I just tried the last version of bootstrap-select deps (https://developer.snapappointments.com/bootstrap-select/) and it seems to work with bs4Dash and shinydashboard: library(shiny)
library(bs4Dash)
library(shinyWidgets)
server <- function(input, output, session) {
output$res <- renderPrint(input$p1)
}
ui_bs4Dash <- bs4DashPage(
navbar = bs4DashNavbar(),
sidebar = bs4DashSidebar(),
body = bs4DashBody(
tags$head(
includeCSS(path = "https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css"),
includeScript(path = "https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js")
),
bs4TabItems(
bs4TabItem(
tabName = "test",
fluidRow(
column(
width = 6,
pickerInput(
inputId = "p1",
label = "Select all option",
choices = rownames(mtcars),
multiple = TRUE,
options = pickerOptions(
actionsBox = TRUE,
selectedTextFormat = "count > 3",
countSelectedText = "{0} cars selected",
showTick = TRUE
)
),
verbatimTextOutput(outputId = "res")
)
)
)
)
)
)
# showTick doesn't work with bs4Dash
shinyApp(ui = ui_bs4Dash, server = server) @thomasthomasth and @prehi12: can you also please try the code above with the last version of bs4Dash devtools::install_github("RinteRface/bs4Dash") With shinydashboard: library(shiny)
library(shinydashboard)
library(shinyWidgets)
shinyApp(
ui = dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
tags$head(
includeCSS(path = "https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css"),
includeScript(path = "https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js")
),
pickerInput(
inputId = "p1",
label = "Select all option",
choices = rownames(mtcars),
multiple = TRUE,
options = pickerOptions(
actionsBox = TRUE,
selectedTextFormat = "count > 3",
countSelectedText = "{0} cars selected",
showTick = TRUE
)
),
verbatimTextOutput(outputId = "res")
),
title = "Dashboard example"
),
server = function(input, output, session) {
output$res <- renderPrint(input$p1)
}
) |
Hi, It looks like it is working now. I hope you will find a stable way and merge it to the CRAN version. Thanks for the great package, anyway. Tamas |
@thomasthomasth: I pushed a patch to shinyWidgets which properly updates dependencies (not like the previous dirty example). devtools::install_github("dreamRs/shinyWidgets") Hence, the example below will work without the need of extra CSS/JS file: library(shiny)
library(bs4Dash)
library(shinyWidgets)
server <- function(input, output, session) {
output$res <- renderPrint(input$p1)
}
ui_bs4Dash <- bs4DashPage(
navbar = bs4DashNavbar(),
sidebar = bs4DashSidebar(),
body = bs4DashBody(
bs4TabItems(
bs4TabItem(
tabName = "test",
fluidRow(
column(
width = 6,
pickerInput(
inputId = "p1",
label = "Select all option",
choices = rownames(mtcars),
multiple = TRUE,
options = pickerOptions(
actionsBox = TRUE,
selectedTextFormat = "count > 3",
countSelectedText = "{0} cars selected",
showTick = TRUE
)
),
verbatimTextOutput(outputId = "res")
)
)
)
)
)
)
# showTick doesn't work with bs4Dash
shinyApp(ui = ui_bs4Dash, server = server) The CRAN versions will follow. |
It's working perfectly now, thank you very much @DivadNojnarg |
Is this the same issue? We have modules which work fine with This issue is not present with the base shiny library(shiny)
library(shinyWidgets)
library(bs4Dash)
shiny::shinyApp(
ui = bs4DashPage(
navbar = bs4DashNavbar(
# `shiny::selectInput` works fine
# specifying "leftUi = " here causes the dropdown to not show any options
leftUi = shinyWidgets::pickerInput(
# shinyWidgets::pickerInput(
inputId = "pickerchoice",
label = NULL,
choices = letters)
),
sidebar = bs4DashSidebar(disable = TRUE),
),
server = function(input, output) {}
) Tested in Firefox and Chrome on Windows 10 x64.
|
I use the
pickerInput
from shinyWidget but the choices are not displayed with bs4Dash :Here is my session info :
The text was updated successfully, but these errors were encountered: