Kony-Local Storage API Elements
Syntax :-
1. kony.store.setItem(key, value)
key [string] - Mandatory
Specifies the keyname for which the item needs to be set
value [object] - Mandatory
key [string] - Mandatory
Specifies the keyname for which the item needs to be set
value [object] - Mandatory
Specifies the value that must be set at the given index. This value can be a number,
string,Boolean
Example :
kony.store.setItem("keyValue5", "this is a key value"); //string
kony.store.setItem("keyValue4", true); //boolean
kony.store.getItem(keyname)
Specifies the keyname from which the item needs to be fetched.
kony.store.setItem("keyValue4", true); //boolean
kony.store.getItem(keyname)
Specifies the keyname from which the item needs to be fetched.
Example :
var myValue = kony.store.getItem("name"); alert("name is "+myValue);
kony.store.removeItem(keyname)
Specifies the keyname for which the item needs to be removed.
Example :
kony.store.removeItem("name"); alert("name removed");
kony.store.clear()
clearing all the key-value pairs
kony.store.key(index)
Specifies the index for which the key name is to be returned.
Example :
var keyName = kony.store.key(0); alert("first key name is "+keyName);
kony.store.length()
Returns the length of the local storage.


