Methods

This section describes the methods used to manipulate the application's view cache.

clear()

Removes all the viewInfo objects from the cache.

getView(key)

Obtains a viewInfo object from the cache by the specified key.

Parameters:
key:

String

A key under which the requested viewInfo object is stored within the view cache.

Return Value:

Object

A requested viewInfo object.

hasView(key)

Checks whether or not a viewInfo object is contained in the view cache under the specified key.

Parameters:
key:

String

The key of the requested viewInfo object.

Return Value:

Boolean

true if the requested viewInfo object is found in the view cache.

off(eventName)

Detaches all event handlers from the specified event.

Parameters:
eventName:

String

The name of the event to unsubscribe from.

Return Value:

Object

The object for which this method is called.

See Also

off(eventName, eventHandler)

Detaches a particular event handler from the specified event.

Parameters:
eventName:

String

The name of the event to unsubscribe from.

eventHandler:

function

The handler to be detached from the specified event.

Return Value:

Object

The object for which this method is called.

See Also

on(eventName, eventHandler)

Subscribes to a specified event.

Parameters:
eventName:

String

The name of the event to be subscribed.

eventHandler:

function

An event handler for the specified event.

Return Value:

Object

The object for which this method is called.

Use this method to subscribe to one of the events listed in the Events section.

See Also

on(events)

Subscribes to the specified events.

Parameters:
events:

Object

An object of the following structure: { "eventName1": handler1, "eventName2": handler2, ...}

Return Value:

Object

The object for which this method is called.

Use this method to subscribe to several events with one method call. Available events are listed in the Events section.

See Also

removeView(key)

Removes a viewInfo object from the cache by the specified key.

Parameters:
key:

String

A key under which the viewInfo object to be removed is stored within the view cache.

Return Value:

Object

The viewInfo object that has been removed.

This method fires the viewRemoved event after the viewInfo object has been removed.

setView(key, viewInfo)

Adds the specified viewInfo object to the cache under the specified key.

Parameters:
key:

String

A key for the added viewInfo object.

viewInfo:

Object

An object whose fields define information on the cached view.