sets values into the inputs of a form/toolbar/property sheet control
values | object | a object with "property:value" pairs |
update | boolean | optional, if true, updates the form with new values while existing values remain. false by default, all old values are cleared |
config | any | operation config |
webix.ui({
view:"form",
id:"form1",
elements:[
{ type:"text", name:"field_a" },
{ type:"text", name:"field_b" },
]
});
function set_form(){
$$("form1").setValues({
field_a: "London",
field_b: "New York"
});
};
The method allows setting several values at a time. Data names of these values must coincide with values of the name parameters of the corresponding form elements. Mind that without the update parameter the method clears all old values. To update certain fields and leave the rest unaffected, pass true.
The third parameter can be of any type (from a string to an object). The config will be passed to the onChange event as the 3rd parameter.