Skip to main content

beforeHide

fires before a window is hidden

beforeHide: (position: object, e?: Event) => boolean | void;

Parameters:

  • position: object - an object with coordinates of the window's position. The parameter contains two attributes:
    • left: number - the left coordinate of the window's position (in pixels)
    • top: number - the top coordinate of the window's position (in pixels)
  • events: Event - a native event object

Returns:

Return true to hide a window, false to block hiding a window.

Example

dhxWindow.events.on("beforeHide", function(position, events){
console.log("A window will be hidden", events);
return true;
});

Related sample: Window. Events

Note, the event fires in 2 cases:

  1. While calling the hide() method.
  2. While the closable option is enabled and a user clicks on the Close icon. When the user closes the window by clicking on the Close icon, the native event object will be passed into the second argument.

Change log:

The position and events parameters have been added in v7.0.