Error when using selectizeInput (Selectize.js) with plug-ins

997 views
Skip to first unread message

Lalas

unread,
Jun 17, 2014, 4:00:02 PM6/17/14
to shiny-...@googlegroups.com
Hello...

Following the instructions described in the following post: "using selectize.js plugin options in Shiny", i have the following example which works:

my_app_tmp <- list(
  ui = shinyUI(fluidPage(
    title = 'Selectize examples',
    h3("Selectize examples with drag and drop"),
    tags$head(
    ),
    sidebarLayout(
      sidebarPanel(width=3,
                   #dateRangeInput(inputId = 'mydateRange', label = tags$h5('Date Range: (yyyy-mm-dd)'), start = "2013-09-30", end = "2013-10-01"),
                   selectizeInput(inputId='s1', label= tags$h5('Selectize Example'), choices = NULL, multiple = TRUE,
                                  options = list(
                                    placeholder = 'Please select/type something',
                                    onInitialize = I('function() { this.setValue(""); }'),
                                    plugins = list('restore_on_backspace', 'remove_button', 'drag_drop'),
                                    create =  TRUE,
                                    delimiter = ',',
                                    persist = FALSE
                                  ))
      ),  
      mainPanel(width=9, verbatimTextOutput("out")))
  )),
  server = shinyServer(function(input, output, session) { output$out <- renderPrint({input$s1}) })
)
runApp(my_app_tmp)
 
However, when i un-comment the dateRangeInput controller in the ui; i end up with an error in the javascript console (Chrome); stating:

"Uncaught TypeError: Cannot read property 'empty' of undefined" relating to ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js:6


Would someone be able to help me understand why I am encountering this error. More specifically, why when i comment "dateRangeInput", the shiny app works fine, and when i include it, i get an error.

Thank you very much in advance..

session info:

R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

and i am using shiny 0.9.1.9009

Lalas

unread,
Jun 20, 2014, 8:17:43 PM6/20/14
to shiny-...@googlegroups.com
anyone was able to replicate or resolve this problem??

Lalas

unread,
Jun 25, 2014, 7:23:17 PM6/25/14
to shiny-...@googlegroups.com
Found the answer in the source code. 

In particular: In the file, jqueryui.R, on line 83-84, it says:

# IMPORTANT NOTE: If you update jqueryui, make sure you DON'T include the datepicker,
# as it collides with our bootstrap datepicker!

The code below doesn't use a custom version of the jQuery UI, and hence the error.

d...@industrydive.com

unread,
Sep 1, 2016, 11:16:28 AM9/1/16
to Shiny - Web Framework for R
I've been able to reproduce and have put in an issue https://github.com/rstudio/shiny/issues/1346
Reply all
Reply to author
Forward
0 new messages