срабатывает после того, как данные были изменены в контроле формы или тулбара
newValue | any | newly set value |
oldValue | any | previous value |
config | any | source of change |
$$("form1").elements["login"].attachEvent("onChange", function(newv, oldv, config){
//"login" is name of related form field
webix.message("Value changed from: "+oldv+" to: "+newv);
});
//or
$$("form1").attachEvent("onChange", function(newv, oldv, config){
webix.message("Value changed from: "+oldv+" to: "+newv);
});
The config parameter can have the following values:
Also, you can get a custom value as the config parameter. To do that call the setValues method passing your value as the last argument:
webix.ui({
view:"form",
// ..config
on:{
onChange: function(newValue, oldValue, config){
// config is {yourProperty: "yourValue"}
}
}
});
// onChange event will receive object as the last parameter
$$("$form1").setValues(values, true, {yourProperty: "yourValue"});