根据Shining+中的标签删除列表;R
我不熟悉R和Shiny,因此不了解高级Shiny和R小部件/编程 如果单击“添加列表”按钮,我正在创建列表。列表标记为“列表1”、“列表2”。它很好用 我有多个删除按钮对应于每个添加的列表,标签如“删除列表1”、“删除列表2”等 如何具体删除列表,例如,当我单击“删除列表3”时,只需要删除该特定列表3 我的代码现在删除最新添加的列表,无论单击哪个按钮。我的代码如下:根据Shining+中的标签删除列表;R,r,shiny,shiny-server,R,Shiny,Shiny Server,我不熟悉R和Shiny,因此不了解高级Shiny和R小部件/编程 如果单击“添加列表”按钮,我正在创建列表。列表标记为“列表1”、“列表2”。它很好用 我有多个删除按钮对应于每个添加的列表,标签如“删除列表1”、“删除列表2”等 如何具体删除列表,例如,当我单击“删除列表3”时,只需要删除该特定列表3 我的代码现在删除最新添加的列表,无论单击哪个按钮。我的代码如下: for(x in 1:length(uiElements)){ uiElements &l
for(x in 1:length(uiElements)){
uiElements <- deleteElements(x,input,uiElements)
}
deleteElements <- function(x,input,uiElements){
cntr <- GetCounter()
uiLabel <- paste("List",x,sep=" ")
delLabel <- paste("Delete",uiLabel,sep=" ")
if(!is.null(input[[delLabel]]) && input[[delLabel]] > 0 && cntr> 1){
cntr <- cntr - 1
SetCounter(cntr)
uiElements <- uiElements[-which(uiElements==uiLabel)]
}
return (uiElements)
for(x/1:长度(uiElements)){
uiElements