setValues

sets values into the inputs of a form/toolbar/property sheet control

void setValues(object values, [boolean update] );

Parameters

valuesobjecta hash of "property:value" pairs
updatebooleanoptional, if true, updates the form with new values while existing values remain. false by default, all old values are cleared

Example

webix.ui({
    view:"form",
    id:"form1",
    elements:[
        { type:"text", name:"field_a" },
        { type:"text", name:"field_b" },
    ]
});
 
function set_form(){
    $$("sheet").setValues({
       field_a: "London", 
       field_b: "New York"
    });
};

Related samples

Details

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.

See also
Back to top
If you have not checked yet, be sure to visit site of our main product Webix javascript ui framework and page of javascript form product.