View source: R/rk.XML.optionset.R
rk.XML.optionset | R Documentation |
Note that if you want to refer to the optioncolumns in your JavaScript code, the id
you need is a combination of <optionset id>.<optioncolumn id>.<modifier>
. that is,
you must always prefix it with the sets' id
. For JavaScript code generating with
rkwarddev
,
the easiest way to get to results is to use rk.JS.optionset
.
It will automatically place your code fragments into a for loop and iterate through all available
rows of the set.
rk.XML.optionset( content, optioncolumn, min_rows = 0, min_rows_if_any = 0, max_rows = 0, keycolumn = NULL, logic = NULL, optiondisplay = TRUE, id.name = "auto" )
content |
A list of XiMpLe.nodes to be placed inside the |
optioncolumn |
A list of |
min_rows |
Numeric (integer), if specified, the set will be marked invalid, unless it has at least this number of rows. Ignored if set to 0. |
min_rows_if_any |
Numeric (integer), like min_rows, but will only be tested, if there is at least one row. Ignored if set to 0. |
max_rows |
Numeric (integer), if specified, the set will be marked invalid, unless it has at most this number of rows. Ignored if set to 0. |
keycolumn |
Character |
logic |
A valid |
optiondisplay |
Logical value,
can be used to automatically add an |
id.name |
Character string, a unique ID for this plugin element.
If |
If this isn't flexible enough for your needs,
you can also use the ID that functions like id
return,
because the JavaScript variable name will only contain a constant prefix ("ocol") and the column ID.
An object of class XiMpLe.node
.
The <optionset>
node was introduced with RKWard 0.6.1, please set the dependencies
of your component/plugin accordingly.
rk.XML.optioncolumn
,
rk.XML.optiondisplay
,
rk.JS.optionset
,
and the Introduction to Writing Plugins for RKWard
firstname <- rk.XML.input("Given name(s)") lastname <- rk.XML.input("Family name") genderselect <- rk.XML.radio("Gender", options=list( Male = c(val="m"), Female = c(val="f"))) (myOptionset <- rk.XML.optionset( content = list( rk.XML.row( firstname, lastname, genderselect)), optioncolumn = list( rk.XML.optioncolumn(firstname, modifier="text"), rk.XML.optioncolumn(lastname, modifier="text"), rk.XML.optioncolumn(genderselect) ) ))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.