options

defines options for the select control

array|string options;

Example

// simple array
{ view:"select", label:"Version", options:["1.0", "1.5", "2.0"]}
 
// id-value pairs
{ view:"select", value: 2, label:"Branch", options:[
    { "id":1, "value":"Master" },
    { "id":2, "value":"Release" }
]},
 
// server-side options
{ view:"select", label:"Version", options:"server/options.php" }

Related samples

Details

Options can be set as:

  • an array of strings;
  • an array of objects, each with the id and value properties, where
    • id - (string, number) the item ID, which serves as the real value of the option for inner logic;
    • value - (string) the item label, which is the displayed string of the option;
  • a string with a path to the script that loads options from the server.

The initially selected option is defined by the value property.

See also
Back to top