Namespace jQuery.sap.storageModule: jquery.sap.storage


Returns a Storage object for a given HTML5 storage (type) and, as a convenience, provides static functions to access the default (session) storage.

When called as a function, it returns an instance of jQuery.sap.storage.Storage, providing access to the storage of the given jQuery.sap.storage.Type or to the given HTML5 Storage object.

The default session storage can be easily accessed with methods jQuery.sap.storage.get, jQuery.sap.storage.put, jQuery.sap.storage.remove, jQuery.sap.storage.clear, jQuery.sap.storage.getType and jQuery.sap.storage.removeAll


Since: 0.11.0.
Namespaces & Classes
StorageA Storage API for JavaScript.
TypeEnumeration of the storage types supported by jQuery.sap.storage.Storage
Method Summary
jQuery.sap.storage.clear()Deletes all the entries saved in the session (Independent of the current Storage instance!).
jQuery.sap.storage.get(sId)Retrieves the state string stored in the session under the key sStorageKeyPrefix + sId.
jQuery.sap.storage.getType()Returns the type of the storage.
jQuery.sap.storage.isSupported()Returns whether the given storage is suppported.
jQuery.sap.storage.put(sId, sStateToStore)Stores the passed state string in the session, under the key sStorageKeyPrefix + sId.
jQuery.sap.storage.remove(sId)Deletes the state string stored in the session under the key sStorageKeyPrefix + sId.s

sStorageKeyPrefix is the id prefix defined for the storage instance (@see jQuery.sap#storage)

jQuery.sap.storage.removeAll(sIdPrefix)Deletes all state strings stored in the session under the key prefix sStorageKeyPrefix + sIdPrefix.
Method Detail
jQuery.sap.storage.clear(): boolean
Deletes all the entries saved in the session (Independent of the current Storage instance!).

CAUTION: This method should be called only in very particular situations, when a global erasing of data is required. Given that the method deletes the data saved under any ID, it should not be called when managing data for specific controls.

Returns:
{boolean} true if execution of removal was successful or the data to remove doesn't exist, and false if the feature is unavailable or a problem occurred
jQuery.sap.storage.get(sId): string
Retrieves the state string stored in the session under the key sStorageKeyPrefix + sId.

sStorageKeyPrefix is the id prefix defined for the storage instance (@see jQuery.sap#storage)

Parameters:
{string}sId Id for the state to retrieve
Returns:
{string} the string from the storage, if the retrieval was successful, and null otherwise
jQuery.sap.storage.getType(): jQuery.sap.storage.Type|string
Returns the type of the storage.
Returns:
{jQuery.sap.storage.Type|string} the type of the storage or "unknown"
jQuery.sap.storage.isSupported(): boolean
Returns whether the given storage is suppported.
Returns:
{boolean} true if storage is supported, false otherwise (e.g. due to browser security settings)
jQuery.sap.storage.put(sId, sStateToStore): boolean
Stores the passed state string in the session, under the key sStorageKeyPrefix + sId.

sStorageKeyPrefix is the id prefix defined for the storage instance (@see jQuery.sap#storage)

Parameters:
{string}sId Id for the state to store
{string}sStateToStore content to store
Returns:
{boolean} true if the data were successfully stored, false otherwise
jQuery.sap.storage.remove(sId): boolean
Deletes the state string stored in the session under the key sStorageKeyPrefix + sId.s

sStorageKeyPrefix is the id prefix defined for the storage instance (@see jQuery.sap#storage)

Parameters:
{string}sId Id for the state to delete
Returns:
{boolean} true if the deletion was successful or the data doesn't exist under the specified key, and false if the feature is unavailable or a problem occurred
jQuery.sap.storage.removeAll(sIdPrefix): boolean
Deletes all state strings stored in the session under the key prefix sStorageKeyPrefix + sIdPrefix.

sStorageKeyPrefix is the id prefix defined for the storage instance (@see jQuery.sap#storage)

Parameters:
{string}sIdPrefix Id prefix for the states to delete
Since:
1.13.0
Returns:
{boolean} true if the deletion was successful or the data doesn't exist under the specified key, and false if the feature is unavailable or a problem occurred