2015-10-14 20 views
1

我試圖在Shiny中顯示值的下拉列表。但它似乎沒有顯示初始值。select(ize)輸入在Shiny中不顯示初始值

selectizeInput('id', label = "Year", choices = 
NULL, multiple=FALSE,selected="X2015",            options = list(create = 
TRUE,placeholder = 'Choose year')) 

year <- c("X2001","X2002","X2003","X2004","X2005","X2006","X2007","X2008", 
     "X2009","X2010","X2011","X2012","X2013","X2014","X2015","X2016", 
     "X2017","X2018")           

    updateSelectizeInput(session, 'id', choices = year, server = TRUE) 
+0

我從來沒有用過'updateSelectizeInput'所以我不知道,但不應該有與一個'selected'參數初始值? http://shiny.rstudio.com/reference/shiny/latest/updateSelectInput.html – user5029763

+0

我相信這個問題已經在閃亮的開發版本中得到修復。請嘗試'devtools :: install_github('rstudio/shiny')' –

+0

@ user5029763。將選中的選項添加到updateSelectizeInput工作。 –

回答

0

添加所選參數updateSelectizeInput設置默認

updateSelectizeInput(session, 'id', choices = year, server = TRUE,selected="2001")