dojox/calendar/StoreManager (version 1.10)

dojo/Stateful, dojo/Evented

Summary

This mixin contains the store management.

See the dojox/calendar/StoreManager reference documentation for more information.

Property Summary

  • _attrPairNamesUsed across all instances a hash to cache attribute names and their getter and setter names.
  • _ownerItemsProperty
  • ownerThe owner of the store manager: a view or a calendar widget.
  • storeThe store that contains the events to display.

Method Summary

Properties

_attrPairNames
Defined by: dojo/Stateful

Used across all instances a hash to cache attribute names and their getter and setter names.

_ownerItemsProperty
owner

The owner of the store manager: a view or a calendar widget.

store

The store that contains the events to display.

Methods

_changeAttrValue(name,value)
Defined by dojo/Stateful

Internal helper for directly changing an attribute value.

Directly change the value of an attribute on an object, bypassing any accessor setter. Also handles the calling of watch and emitting events. It is designed to be used by descendant class when there are two values of attributes that are linked, but calling .set() is not appropriate.

Parameter Type Description
name String

The property to set.

value Mixed

The value to set in the property.

Returns:function

Internal helper for directly changing an attribute value.

_cleanItemStoreState(id)
Parameter Type Description
id undefined
Returns:undefined | boolean
_computeVisibleItems(renderData)

Computes the data items that are in the displayed interval.

Parameter Type Description
renderData Object

The renderData that contains the start and end time of the displayed interval.

Returns:undefined
_get(name,names)
Defined by dojo/Stateful

Private function that does a get based off a hash of names

Parameter Type Description
name undefined
names undefined

Hash of names of custom attributes

Returns:undefined
_getAttrNames(name)
Defined by dojo/Stateful

Helper function for get() and set(). Caches attribute name values so we don't do the string ops every time.

Parameter Type Description
name undefined
Returns:undefined | object
_getItemStoreStateObj(item)
Parameter Type Description
item Object
Returns:undefined | null
_getParentStoreManager()
Returns:undefined | null
_initItems(items)
Parameter Type Description
items undefined
Returns:undefined
_itemsSetter(value)
Parameter Type Description
value undefined
_setItemStoreState(item,state)
Parameter Type Description
item Object
state String
_storeSetter(value)
Parameter Type Description
value undefined
Returns:undefined
_updateItems(object,previousIndex,newIndex)
Parameter Type Description
object Object

an abstract Object object (see dojox.gfx3d.defaultEdges, dojox.gfx3d.defaultTriangles, dojox.gfx3d.defaultQuads dojox.gfx3d.defaultOrbit dojox.gfx3d.defaultCube or dojox.gfx3d.defaultCylinder)

previousIndex undefined
newIndex undefined
emit(type,event)
Defined by dojo/Evented
Parameter Type Description
type undefined
event undefined
Returns:undefined
get(name)
Defined by dojo/Stateful

Get a property on a Stateful instance.

Get a named property on a Stateful object. The property may potentially be retrieved via a getter method in subclasses. In the base class this just retrieves the object's property.

Parameter Type Description
name String

The property to get.

Returns:any | undefined

The property value on this Stateful instance.

Examples

Example 1

require(["dojo/Stateful", function(Stateful) {
    var stateful = new Stateful({foo: 3});
    stateful.get("foo") // returns 3
    stateful.foo // returns 3
});
getItemStoreState(item)

Returns the creation state of an item. This state is changing during the interactive creation of an item. Valid values are: - "unstored": The event is being interactively created. It is not in the store yet. - "storing": The creation gesture has ended, the event is being added to the store. - "stored": The event is not in the two previous states, and is assumed to be in the store (not checking because of performance reasons, use store API for testing existence in store). item: Object The item. returns: String

Parameter Type Description
item undefined
Returns:undefined | string
on(type,listener)
Defined by dojo/Evented
Parameter Type Description
type undefined
listener undefined
Returns:undefined
postscript(params)
Defined by dojo/Stateful
Parameter Type Description
params Object
Optional
set(name,value)
Defined by dojo/Stateful

Set a property on a Stateful instance

Sets named properties on a stateful object and notifies any watchers of the property. A programmatic setter may be defined in subclasses.

Parameter Type Description
name String

The property to set.

value Object

The value to set in the property.

Returns:any | function

The function returns this dojo.Stateful instance.

Examples

Example 1

require(["dojo/Stateful", function(Stateful) {
    var stateful = new Stateful();
    stateful.watch(function(name, oldValue, value){
        // this will be called on the set below
    }
    stateful.set(foo, 5);

set() may also be called with a hash of name/value pairs, ex:

stateful.set({
    foo: "Howdy",
    bar: 3
});
});

This is equivalent to calling set(foo, "Howdy") and set(bar, 3)

watch(name,callback)
Defined by dojo/Stateful

Watches a property for changes

Parameter Type Description
name String
Optional

Indicates the property to watch. This is optional (the callback may be the only parameter), and if omitted, all the properties will be watched

callback Function

The function to execute when the property changes. This will be called after the property has been changed. The callback will be called with the |this| set to the instance, the first argument as the name of the property, the second argument as the old value and the third argument as the new value.

Returns:any | object

An object handle for the watch. The unwatch method of this object can be used to discontinue watching this property:

var watchHandle = obj.watch("foo", callback);
watchHandle.unwatch(); // callback won't be called now
Error in the documentation? Can’t find what you are looking for? Let us know!