onChange

fires when the value of the control is changed

void onChange(any newValue,any oldValue, [any config] );
newValue
anynewly set value oldValue
anyprevious value config
anysource of change

Example

$$("control").attachEvent("onChange", function(newValue, oldValue, config){
    webix.message(
      `Value changed from ${oldValue} to ${newValue}. Source: ${config}`
    );
});

Related samples

Details

The config parameter can have the following values:

Also, you can get a custom value as the config parameter. To do that call the setValue/setValues method passing your value as the last argument:

webix.ui({
  view:"button",
  // ..config
  on:{
    onChange: function(newValue, oldValue, config){
        // config is {yourProperty: "yourValue"}
    }
  }
});
 
// onChange event will receive object as the 3rd parameter
$$("$button1").setValue(newValue, {yourProperty: "yourValue"});
See also
  • API
  • Articles
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.