dojox.storage.Provider.putMultiple
dojo.require("dojox.storage.Provider");
defined in dojox/storage/Provider.js
Example- var resultsHandler = function(status, key, message){ alert("status="+status+", key="+key+", message="+message); }; dojox.storage.put(["test"], ["hello world"], resultsHandler);
Important note: if you are using Dojo Storage in conjunction with Dojo Offline, then you don't need to provide a resultsHandler; this is because for Dojo Offline we use Google Gears to persist data, which has unlimited data once the user has given permission. If you are using Dojo Storage apart from Dojo Offline, then under the covers hidden Flash might be used, which is both asychronous and which might get denied; in this case you must provide a resultsHandler.
Usage
parameter | type | description |
---|---|---|
keys | Array | An array of string keys to use when retrieving this value in the future, one per value to be stored |
values | Array | An array of values to store; this can be any JavaScript type, though the performance of plain strings is considerably better |
resultsHandler | Function | A callback function that will receive three arguments. The first argument is one of three values: dojox.storage.SUCCESS, dojox.storage.FAILED, or dojox.storage.PENDING; these values determine how the put request went. In some storage systems users can deny a storage request, resulting in a dojox.storage.FAILED, while in other storage systems a storage request must wait for user approval, resulting in a dojox.storage.PENDING status until the request is either approved or denied, resulting in another call back with dojox.storage.SUCCESS. The second argument in the call back is the key name that was being stored. The third argument in the call back is an optional message that details possible error messages that might have occurred during the storage process. |
namespace | String | Optional. Optional string namespace that this value will be placed into; if left off, the value will be placed into dojox.storage.DEFAULT_NAMESPACE |