setValue

selects the option by its ID

void setValue(string value, [any config] );
valuestringa new value for the control
configanyoperation config

Example

webix.ui({
    view:"segmented", id:"sg1", options:[
       { id:"one", value:"One"},
       { id:"two", value:"Two"},
       { id:"three", value:"Three"}
    ]
});
 
$$("sg1").setValue("two"); // choose the second option

Details

The second parameter can be of any type (from a string to an object). config will be passed to the onChange event as the last parameter.

See also
Back to top