Closed zameji closed 6 years ago
Hi @zameji, you may notice print(str(c("A", "B", "C")))
also returns additional NULL
. This is because function str()
works by its side effect (output to the terminal) and return nothing (NULL
), and function print()
print out the NULL
returned by str()
, so you will see the items output by str()
first, then a NULL
by print()
.
Hi @Yang-Tang, thank you for the clarification! I was wondering where does the NULL come from and why is it listed after the actual str()
output. Now that's clear. Sorry for the false alarm!
Instead of just the items, orderInput returns the items and NULL. Smalles working example:
library(shiny) library(shinyjqui)
shinyApp( ui = fluidPage( orderInput('ns', 'Numbers', items = c("A", "B", "C"), as_source = FALSE, width="100%", item_class="primary", placeholder="Numeric variables"), actionButton("save", "Save") ), server = function(input, output) { vals <- reactiveValues(v=NULL) observeEvent(input$save, {vals$v <- input$ns_order print(str(vals$v)) }) } )