Class AjxDispatcher
AjxDispatcher.register("Compose", "Mail", new AjxCallback(this, this.doAction));and a client call of it like this: AjxDispatcher.run("Compose", {action:ZmOperation.NEW_MESSAGE, inNewWindow:false});Registration will most likely need to happen in a constructor, when 'this' is available, since you'll most likely want the function call to happen in that object's context. A package can also register a callback to be run once the package has loaded. One use case for that is to register newly-defined classes as drop targets. There is a wrapper method around AjxPackage.require() that will call that method and then run the post-load callback (if any): AjxDispatcher.require("Calendar"); Defined in: AjxDispatcher.js.
Field Detail
<static>
AjxDispatcher.setPackageLoadFunction
<static>
AjxDispatcher.setPostLoadFunction
<static>
AjxDispatcher.setPreLoadFunction
Method Detail
<static>
AjxDispatcher.addPackageLoadFunction(pkg, callback)
Adds a function to be called after the given package has been loaded.
<static>
AjxDispatcher.addPostLoadFunction(callback)
Adds a function to be called after a package has been loaded. A typical use
is to clear a "Loading..." screen.
<static>
AjxDispatcher.addPreLoadFunction(callback)
Adds a function to be called while a package is being loaded. A typical use
is to display a "Loading..." screen.
<static>
AjxDispatcher.enableLoadFunctions(enabled)
Enables/disables the running of the pre/post load functions.
<static>
{boolean}
AjxDispatcher.loaded(pkg)
Checks if the given package has been loaded.
<static>
AjxDispatcher.registerMethod(method, pkg, callback)
Registers an API method so that it may be called.
<static>
AjxDispatcher.require(pkg, async, callback, args, preLoadOk)
Loads the given package, and runs its requested post-load callback. Clients should
be careful not to mix async and sync calls for the same package, in order to avoid
race conditions.
<static>
{boolean}
AjxDispatcher.setLoaded(pkg, loaded)
Programmatically sets whether the given packages has been loaded. Use with care!
|
||||||||||||||||||||||||||||||
Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:25 GMT-0400 (EDT)
|