onChange

fires when the user changes the value of the DataRecord object

void onChange();

Example

var data = new webix.DataRecord({
  id:"data",
  name:"Anna Gretim",
  title:"Ms."
});
$$("myForm").bind(data);
// ...
 
data.attachEvent("onChange", function(obj, config){
    alert("Your new object is: "+ obj.title + obj.name);
});

Details

The function executed on this event, takes 2 arguments:

  • data - data object
  • config - source of the change. Can have the following values:
    • "user" - if the change is made by user
    • "auto" - if the change is made by the library.

You can pass a custom value of any type to the config parameter. To do that call the setValues method passing your value as the 2nd parameter.

See also
Back to top