onChange

fires when a user changes month, year or time in selector

void onChange(object range, [any config] );
rangeobjectrange object with "start" and "end" fields for currently selected date range
configanysource of change

Example

$$("$daterange1").attachEvent("onChange", function(range, config){
    //... some code here ... 
});

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:"daterange",
  // ..config
  on:{
    onChange: function(range, config){
        // config is {yourProperty: "yourValue"}
    }
  }
});
 
// onChange event will receive object as the last parameter
$$("$daterange1").setValue(newValue, {yourProperty: "yourValue"});
See also
Back to top