bs4Dash
bs4Dash copied to clipboard
Is any way to update controlbar pinned?
Hi David,
Thanks for this wonderful Shiny UI package,
I tried to use shinyjs::click('controlbarPin') ,or shinyjs::runjs("document.getElementById('controlbarPin').click()") and some methods to update controlbar pinned in some conditions.
But shinyjs click only work on dashboardBody button. Is any functions or advices for updating the controlbar pinned?
Thanks you a lot!
Hey, if you're using dashboardControlbar()
, there's a parameter named pinned
which you can pass a boolean argument to. Pass TRUE
and the controlbar will stay pinned unless the user unpins it manually.
Hi,
Thanks for reply :) Sorry I wasn't cleanly asked my question.
I had set dashboardControlbar()
parameter pinned = TRUE
, and overlay = TRUE
in app beginning.
but I need when user in some condition (like during cicerone tour guide, I want pinned but when end the guide, I wish it can automatically click controlbarPin to swtich status for pinned = FALSE ).
so maybe it will has some function can update pinned like updateControlbar()
to use in observeEvent()
...
I tried using shinyjs::click()
but didn't work.
Thank you so much for responding 👍
I find a method to treat this state.
Only use shinyjs::extendShinyjs
to create function
ui
useShinyjs(),
shinyjs::extendShinyjs(text = "shinyjs.clickpin = function(){$('#controlbarPin').click()}",functions = c("clickpin"))
server
js$clickpin()
and it will be work.
Ok. This is good idea for the next release.