Skip to main content

beforeHide

fires before a control is hidden

beforeHide: (value: string | ITimeObject, init: boolean) => boolean | void;

Parameters:

  • value: string | object - the current value of the control
  • init: boolean - true, if the event is triggered on the control initialization; otherwise, false

Returns:

Return false to prevent a control from being hidden; otherwise, true.

Example

form.getItem("timepicker").events.on("beforeHide", function(value, init) {    console.log("beforeHide", value, init);    return true;});

The type of the value parameter depends on the applied valueFormat and timeFormat:

  • If valueFormat: "string" and timeFormat:24 are specified, the string value will include just the hour and minutes: "00:39"
  • If valueFormat: "string" and timeFormat:12 are specified, the string value will include hour, minutes, and am/pm identifiers: "06:00AM"
  • If valueFormat: "timeObject" and timeFormat:24 are specified, the object value will contain key:value pairs for hours, minutes and their values: {hour: 0, minute: 39}
  • If valueFormat: "timeObject" and timeFormat:12 are specified, the object value will contain key:value pairs for hours, minutes, am/pm identifiers and their values: {hour: 6, minute: 0, AM: true}

Change log:

added in v7.0