Functiondojox.off.onFrameworkEvent

dojo.require("dojox.off._common");
defined in dojox/off/_common.js

For advanced usage; most developers can ignore this. A standard event handler that can be attached to to find out about low-level framework events. Most developers will not need to attach to this method; it is meant for low-level information that can be useful for updating offline user-interfaces in exceptional circumstances. The default Dojo Offline UI widget takes care of most of these situations.

Usage

function (/*String*/ type, /*Object?*/ saveData) (view source)
parametertypedescription
typeStringThe type of the event: * "offlineCacheInstalled" An event that is fired when a user has installed an offline cache after the page has been loaded. If a user didn't have an offline cache when the page loaded, a UI of some kind might have prompted them to download one. This method is called if they have downloaded and installed an offline cache so a UI can reinitialize itself to begin using this offline cache. * "coreOperationFailed" Fired when a core operation during interaction with the offline cache is denied by the user. Some offline caches, such as Google Gears, prompts the user to approve or deny caching files, using the database, and more. If the user denies a request that is core to Dojo Offline's operation, we set dojox.off.coreOpFailed to true and call this method for listeners that would like to respond some how to Dojo Offline 'failing fast'. * "save" Called whenever the framework saves data into persistent storage. This could be useful for providing save feedback or providing appropriate error feedback if saving fails due to a user not allowing the save to occur
saveDataObjectOptional. If the type was 'save', then a saveData object is provided with further save information. This object has the following properties: * status - dojox.storage.SUCCESS, dojox.storage.PENDING, dojox.storage.FAILED Whether the save succeeded, whether it is pending based on a UI dialog asking the user for permission, or whether it failed. * isCoreSave - boolean If true, then this save was for a core piece of data necessary for the functioning of Dojo Offline. If false, then it is a piece of normal data being saved for offline access. Dojo Offline will 'fail fast' if some core piece of data could not be saved, automatically setting dojox.off.coreOpFailed to 'true' and dojox.off.enabled to 'false'. * key - String The key that we are attempting to persist * value - Object The object we are trying to persist * namespace - String The Dojo Storage namespace we are saving this key/value pair into, such as "default", "Documents", "Contacts", etc. Optional.