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
useShinyjs() in navbarPage() #16
Comments
2 things:
|
I had already tried putting the command in many other places, but the ghost panel always came up. The tagList() idea worked, though. Thanks. |
If you put
|
Thanks for putting up the issue btw, I much prefer this than peopl emailing me, hopefully others in the future will also find this helpful |
@daattali a heads up that remove.packages("shiny")
#> Removing package from '/Library/Frameworks/R.framework/Versions/3.4/Resources/library'
#> (as 'lib' is unspecified)
devtools::install_version("shiny", version = "1.0.3", repos = "http://cran.us.r-project.org")
#> Downloading package from url: http://cran.us.r-project.org/src/contrib/Archive/shiny/shiny_1.0.3.tar.gz
#> Installing shiny
#> '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file \
#> --no-environ --no-save --no-restore --quiet CMD INSTALL \
#> '/private/var/folders/5g/g2ms7qb140j1js402p4m37jm0000gn/T/RtmpPz8R5a/devtools8cff3247c36f/shiny' \
#> --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library' \
#> --install-tests
#>
library("shiny")
library("shinyjs")
#>
#> Attaching package: 'shinyjs'
#> The following object is masked from 'package:shiny':
#>
#> runExample
#> The following objects are masked from 'package:methods':
#>
#> removeClass, show
ui <- shinyUI(
navbarPage(
useShinyjs(),
"Foo",
tabPanel(
"this",
"that"
)
)
)
server <- function(input, output){
}
shinyApp(ui, server) But from version 1.0.4 onwards the following error is returned: remove.packages("shiny")
#> Removing package from '/Library/Frameworks/R.framework/Versions/3.4/Resources/library'
#> (as 'lib' is unspecified)
install.packages("shiny")
#>
#> The downloaded binary packages are in
#> /var/folders/5g/g2ms7qb140j1js402p4m37jm0000gn/T//RtmpufpyYJ/downloaded_packages
library("shiny")
library("shinyjs")
#>
#> Attaching package: 'shinyjs'
#> The following object is masked from 'package:shiny':
#>
#> runExample
#> The following objects are masked from 'package:methods':
#>
#> removeClass, show
ui <- shinyUI(
navbarPage(
useShinyjs(),
"Foo",
tabPanel(
"this",
"that"
)
)
)
#> Error in divTag$attribs: $ operator is invalid for atomic vectors
server <- function(input, output){
}
shinyApp(ui, server)
#> Error in force(ui): object 'ui' not found |
Thanks for the heads up. I wonder wjat changed. Although to be honest I
don't think it was ever a good idea to place the call there because the
first argument expects a tittle. My recommendation for using shinyjs is
navbarpages has always been this:
http://deanattali.com/shinyjs/advanced#usage-navbarpage
But if youre suffering from this , others will probably too so thanks for
letting me know
…On Sep 18, 2017 11:37, "Martin John Hadley" ***@***.***> wrote:
@daattali <https://github.com/daattali> a heads up that shiny <1.0.3 was
happy enough with useShinyjs() in the first argument of navbarPage
remove.packages("shiny")#> Removing package from '/Library/Frameworks/R.framework/Versions/3.4/Resources/library'#> (as 'lib' is unspecified)devtools::install_version("shiny", version = "1.0.3", repos = "http://cran.us.r-project.org")#> Downloading package from url: http://cran.us.r-project.org/src/contrib/Archive/shiny/shiny_1.0.3.tar.gz#> Installing shiny#> '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file \#> --no-environ --no-save --no-restore --quiet CMD INSTALL \#> '/private/var/folders/5g/g2ms7qb140j1js402p4m37jm0000gn/T/RtmpPz8R5a/devtools8cff3247c36f/shiny' \#> --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library' \#> --install-tests#>
library("shiny")
library("shinyjs")#> #> Attaching package: 'shinyjs'#> The following object is masked from 'package:shiny':#> #> runExample#> The following objects are masked from 'package:methods':#> #> removeClass, show
ui <- shinyUI(
navbarPage(
useShinyjs(),
"Foo",
tabPanel(
"this",
"that"
)
)
)
server <- function(input, output){
}
shinyApp(ui, server)
But from version 1.0.4 onwards the following error is returned:
remove.packages("shiny")#> Removing package from '/Library/Frameworks/R.framework/Versions/3.4/Resources/library'#> (as 'lib' is unspecified)
install.packages("shiny")#> #> The downloaded binary packages are in#> /var/folders/5g/g2ms7qb140j1js402p4m37jm0000gn/T//RtmpufpyYJ/downloaded_packages
library("shiny")
library("shinyjs")#> #> Attaching package: 'shinyjs'#> The following object is masked from 'package:shiny':#> #> runExample#> The following objects are masked from 'package:methods':#> #> removeClass, showui <- shinyUI(
navbarPage(
useShinyjs(),
"Foo",
tabPanel(
"this",
"that"
)
)
)#> Error in divTag$attribs: $ operator is invalid for atomic vectors
server <- function(input, output){
}
shinyApp(ui, server)#> Error in force(ui): object 'ui' not found
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA6IFJRzdKv-fqjBv0y2k8VK68RqTqciks5sjo4igaJpZM4FOnKJ>
.
|
@daattali it's a royally stupid place to put it, firmly agreed and your advice pages are golden. I'm never going to trouble the shiny repo with this, the new behaviour is not a bug. Historical Martin made a bad decision in a rush, pleasingly present day me found a reprex within 5mins of utter terror from a big thing suddenly failing. |
Hi Dean,
I've got an app set up laid out with navbarPage(). I'm having trouble figuring out where to place
shinyjs::useShinyjs()
so that the app opens correctly on the first tab panel. If you run the following example you'll see what I mean. (Note: in the example I'm using conditional panels instead of things like toggleState(). Getting that to work in navbarPage() is a separate issue; I hope to clear this one up first.)The text was updated successfully, but these errors were encountered: