Default events signal various actions, such as the user clicking a button to Park a window, or a window is being closed. Default events are usually button events.
Button events can be as follows:
Default events can be redefined by user, who can choose to assign other user-defined events instead. In this case, default events will be ignored until they are restored by user.
The user can choose to redefine a default button event by adding any user-defined event instead. To redefine a button default event the user can use attachEvent() method:
dhxWins.window(id).button(id).attachEvent(eventName, handler);
The entire point of an event is to inform a handler that something has happened to a component in the GUI. A handler can figure out what exactly happened and respond in a meaningful way.
The list of events to which user-defined handlers can be attached is given below:
The user can add global event handlers for windows. This can be done in the following way:
dhxWins.attachEvent(eventName, handler);
Note: the names of the events are case-insensitive.
If there is a window to which the user wants to assign a special handler, this can be done by adding the handler to the window directly. While other windows will be calling global handlers, this window with personal handler will call this personal handler:
dhxWins.window(id).attachEvent(eventName, handler);
The user can detach a personal event from a window. In this case a global event handler will be restored for this window, i.e. when personal handler is removed from the window, the window will call global handler.
dhxWins.window(id).detachEvent(eventId);
Global handlers can be easily removed with the help of the following method:
dhxWins.detachEvent(eventId);
In the situation described above windows w2 and w3 will call “globalHandler” when they are focused.
The window w1 will call personal “w1Handler” when focused.