onChange

срабатывает после любого изменения в компоненте

void onChange( [any config] ){ ... };

Parameters

configanysource of change

Example

{ view:"datatable", id:"dtable", data:grid_data },
{
  view:"filter",
  data:grid_data,
  field:"year", // колонка с числами
  on:{
    onChange: function(config){
      const filter = this.getFilterFunction();
      $$("dtable").filter(obj => filter(obj));
    }
  }
}

Related samples

Details

The config parameter can have the following values:

  • "user" - if the change was made by user
  • "auto" - if the change was made by the library inner logic
  • undefined - if the change was made by a control's setValue or Form setValues method call made by a programmer.

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:"filter",
  // ..config
  on:{
    onChange: function(config){
        // config is {yourProperty: "yourValue"}
    }
  }
});
 
// onChange event will receive object as the last parameter
$$("$filter1").setValue(newValue, {yourProperty: "yourValue"});
See also
  • API
  • Articles
  • Наверх