itemList(items=list(), items_name="", item_factory, name, label=name,
help="", tooltip="", attr=list(), model, editor, ...)
function(.) numericItem(1)
make_ui
constructorItem$proto()
callproto
object. Call obj$show_help()
to view its methods and properties.## make icons
imagedir <- system.file("images",package="traitr")
addStockIcons(gsub("\\.png","", list.files(path=imagedir)),
list.files(path=imagedir, full.names=TRUE))
## make item
item <- itemList(items=list(),
items_name="Personnel",
item_factory = function(.) {
a <- anItemGroup(items=list(
name=stringItem(""),
rank=choiceItem("Scout", values=c("Scout","Captain","General")),
serial.number = stringItem("", label="Serial number")))
a$post_process <- function(.) {
.$icon <- tolower(.$get_rank())
}
a$to_string <- function(., drop=TRUE) .$to_R()$name
return(a)
},
name="itemlist")
item$make_ui(container=gwindow("itemList test"))
Run the code above in your browser using DataLab