Sencha Documentation

Super classes

A Provider implementation which saves and retrieves state via cookies. The CookieProvider supports the usual cookie options, such as:
var cp = new Ext.state.CookieProvider({
       path: "/cgi-bin/",
       expires: new Date(new Date().getTime()+(1000*60*60*24*30)), //30 days
       domain: "extjs.com"
   });
   Ext.state.Manager.setProvider(cp);

Config Options

 
domain : String
The domain to save the cookie for. Note that you cannot specify a different domain than your page is on, but you can...
The domain to save the cookie for. Note that you cannot specify a different domain than your page is on, but you can specify a sub-domain, or simply the domain itself like 'extjs.com' to include all sub-domains if you need to access cookies across different sub-domains (defaults to null which uses the same domain the page is running on including the 'www' like 'www.extjs.com')
 
expires : Date
The cookie expiration date (defaults to 7 days from now)
The cookie expiration date (defaults to 7 days from now)
 
path : String
The path for which the cookie is active (defaults to root '/' which makes it active for all pages in the site)
The path for which the cookie is active (defaults to root '/' which makes it active for all pages in the site)
 
secure : Boolean
True if the site is using SSL (defaults to false)
True if the site is using SSL (defaults to false)

Properties

 
var : Object
a -> Array n -> Number d -> Date b -> Boolean s -> String o -> Object -> Empty (null)
a -> Array n -> Number d -> Date b -> Boolean s -> String o -> Object -> Empty (null)

Methods

 
clear( String name ) : Void
Clears a value from the state
Clears a value from the state

Parameters

  • name : String
    The key name

Returns

  • Void
 
decodeValue( String value ) : Mixed
Decodes a string previously encoded with encodeValue.
Decodes a string previously encoded with encodeValue.

Parameters

  • value : String
    The value to decode

Returns

  • Mixed   The decoded value
 
encodeValue( Mixed value ) : String
Encodes a value including type information. Decode with decodeValue.
Encodes a value including type information. Decode with decodeValue.

Parameters

  • value : Mixed
    The value to encode

Returns

  • String   The encoded value
 
get( String name, Mixed defaultValue ) : Mixed
Returns the current value for a key
Returns the current value for a key

Parameters

  • name : String
    The key name
  • defaultValue : Mixed
    A default value to return if the key's value is not found

Returns

  • Mixed   The state data
 
set( String name, Mixed value ) : Void
Sets the value for a key
Sets the value for a key

Parameters

  • name : String
    The key name
  • value : Mixed
    The value to set

Returns

  • Void

Events

 
statechange( Provider this, String key, String value )
Fires when a state change occurs.
Fires when a state change occurs.

Parameters

  • this : Provider
    This state provider
  • key : String
    The state key which was changed
  • value : String
    The encoded value for the state

Returns

  • Void