dbx manual
5. API events
The script provides eight application events which can be used to call other scripting, read or modify dbx-element properties, or control the triggering actions directly — determining whether an action is allowed to proceed, and/or how the result of that action should be handled. To see these events in action, have a look at the API Events demo.
Handling events
The API events
are all properties of the dbxManager object.
You can extend them as methods using anonymous functions:
manager.onstatechange = function()
{
return true;
};
Or by function reference:
function handleStateChange()
{
return true;
}
manager.onstatechange = handleStateChange;
Each method has several properties available to it (documented here individually for each method), and these must be considered read-only values — they can't be destroyed or written over without undermining the core script. So when you need to process a particular value, copy it into a local variable and then use that.
All of the properties are properties of dbxManager,
and since all API
events are too, the properties can be referred from within the handler functions
using this — for example this.group refers
to the applicable group's container from within manager.onstatechange.
Available events
Here's a rundown of each event, the built-in properties that are available to it, and its handler's influence:
![Uses PHP [php]](/images/php.gif)