dojox/calendar/_RendererMixin (version 1.10)

dojo/Stateful

Summary

This class is the base class of calendar renderers.

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

Property Summary

  • _attrPairNamesUsed across all instances a hash to cache attribute names and their getter and setter names.
  • _displayValue
  • _displayValueMap
  • _orientation
  • editedIndicates that the item displayed by this renderer is in editing mode.
  • focusedIndicates that the item displayed by this renderer is focused.
  • hoveredIndicates that the item displayed by this renderer is hovered.
  • itemThe layout item displayed by this renderer.
  • moveEnabledWhether the event displayed by this renderer can be moved.
  • ownerThe view that contains this renderer.
  • resizeEnabledWhether the event displayed by this renderer can be resized.
  • selectedIndicates that the item displayed by this renderer is selected.
  • storeStateIndicates that the item displayed by this renderer is not in the store, being saved to the store or in the store.
  • visibilityLimits

Method Summary

Properties

_attrPairNames
Defined by: dojo/Stateful

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

_displayValue
_displayValueMap
_orientation
edited

Indicates that the item displayed by this renderer is in editing mode.

focused

Indicates that the item displayed by this renderer is focused.

hovered

Indicates that the item displayed by this renderer is hovered.

item

The layout item displayed by this renderer.

moveEnabled

Whether the event displayed by this renderer can be moved.

owner

The view that contains this renderer.

resizeEnabled

Whether the event displayed by this renderer can be resized.

selected

Indicates that the item displayed by this renderer is selected.

storeState

Indicates that the item displayed by this renderer is not in the store, being saved to the store or in the store.

visibilityLimits

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.

_formatTime(rd,d)

Returns the time formatted string.

Parameter Type Description
rd Object

The render data.

d Date

The time to format.

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
_isElementVisible(elt,startHidden,endHidden,size)

Determine whether the item renderer sub element is visible or not.

Parameter Type Description
elt String

The element node.

startHidden Boolean

Indicates that the start of time interval displayed by this item renderer is not the start of the displayed event.

endHidden Boolean

Indicates that the end of time interval displayed by this item renderer is not the end of the displayed event.

size Integer

The size of the item renderer on the time axis.

Returns:boolean
_setEditedAttr(value)
Parameter Type Description
value undefined
_setFocusedAttr(value)
Parameter Type Description
value undefined
_setHoveredAttr(value)
Parameter Type Description
value undefined
_setItemAttr(value)
Parameter Type Description
value undefined
_setSelectedAttr(value)
Parameter Type Description
value undefined
_setState(prop,value,cssClass)
Parameter Type Description
prop undefined
value undefined
cssClass undefined
_setStoreStateAttr(value)
Parameter Type Description
value undefined
_setText(node,text,allowHTML)

Set the text to the specified node.

Parameter Type Description
node Node

The parent node.

text String

The text to display.

allowHTML Boolean

Whether text is containing HTML formatting.

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
});
getDisplayValue(part)
Parameter Type Description
part 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)

updateRendering(w,h)

Updates the visual appearance of the renderer according the new values of the properties and the new size of the component.

Parameter Type Description
w Number
Optional

The width in pixels of the renderer.

h Number
Optional

The height in pixels of the renderer.

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!