Class: SC.CoreView

Defined in: base.js

Field Summary

Class Methods

Instance Methods

Field Detail

SC.CoreView.ATTACHED_BUILDING_IN

The view has been created, rendered and attached and is visible in the display. It is currently transitioning according to the transitionIn property before being fully shown (i.e ATTACHED_SHOWN).


Defined in: statechart.js.
SC.CoreView.ATTACHED_BUILDING_OUT

The view has been created, rendered and attached. It is currently transitioning according to the transitionOut property before being detached (i.e. removed from the document).


Defined in: statechart.js.
SC.CoreView.ATTACHED_BUILDING_OUT_BY_PARENT

The view has been created, rendered and attached. It is currently transitioning according to the transitionOut property before being detached (i.e. removed from the document) because a parent view is being detached.


Defined in: statechart.js.
SC.CoreView.ATTACHED_HIDDEN

The view has been created, rendered and attached, but is not visible in the display.

Test with & SC.CoreView.IS_HIDDEN


Defined in: statechart.js.
SC.CoreView.ATTACHED_HIDDEN_BY_PARENT

The view has been created, rendered and attached, but is not visible in the display due to being hidden by a parent view.


Defined in: statechart.js.
SC.CoreView.ATTACHED_HIDING

The view has been created, rendered and attached. It is currently transitioning according to the transitionHide property before being fully hidden.


Defined in: statechart.js.
SC.CoreView.ATTACHED_PARTIAL

The view has been created and rendered and attached to a parent, but an ancestor is not attached.


Defined in: statechart.js.
SC.CoreView.ATTACHED_SHOWING

The view has been created, rendered and attached and is visible in the display. It is currently transitioning according to the transitionShow property before being fully shown (i.e ATTACHED_SHOWN).


Defined in: statechart.js.
SC.CoreView.ATTACHED_SHOWN

The view has been created, rendered and attached and is visible in the display.


Defined in: statechart.js.
SC.CoreView.ATTACHED_SHOWN_ANIMATING

The view has been created, rendered and attached, is visible in the display and is being animated via a call to animate().


Defined in: statechart.js.
SC.CoreView.DISABLED
The view is disabled.
Defined in: enabled.js.
SC.CoreView.DISABLED_AND_BY_PARENT

The view is disabled itself and is also disabled in the pane due to a disabled ancestor.


Defined in: enabled.js.
SC.CoreView.DISABLED_BY_PARENT

The view is enabled itself, but is effectively disabled in the pane due to a disabled ancestor.


Defined in: enabled.js.
SC.CoreView.ENABLED
The view is enabled.
Defined in: enabled.js.
SC.CoreView.IS_ATTACHED

The view has been attached.

Use a logical AND (single &) to test attached status. For example,

view.get('viewState') & SC.CoreView.IS_ATTACHED

Defined in: statechart.js.
SC.CoreView.IS_DISABLED
The view has been disabled.
Defined in: enabled.js.
SC.CoreView.IS_HIDDEN

The view is invisible in the display.

Use a logical AND (single &) to test hidden status. For example,

view.get('viewState') & SC.CoreView.IS_HIDDEN

Defined in: statechart.js.
SC.CoreView.IS_RENDERED

The view has been rendered.

Use a logical AND (single &) to test rendered status. For example,

view.get('viewState') & SC.CoreView.IS_RENDERED

Defined in: statechart.js.
SC.CoreView.IS_SHOWN

The view is visible in the display.

Use a logical AND (single &) to test shown status. For example,

view.get('viewState') & SC.CoreView.IS_SHOWN

Defined in: statechart.js.
Read Only
isAttached Boolean

Whether the view's layer is attached to a parent or not.

When the view's layer is attached to a parent view, this value will be true.


Defined in: statechart.js.
Default value:
false
Read Only
isVisibleInWindow Boolean

Whether the view is fully or becoming shown or not.

When the view is shown in the window, this value will be true. Note that if the view is transitioning out or hiding, this value will still be true.

This is not necessarily the same as isVisible although the two properties are related. For instance, it's possible to set isVisible to true and still have isVisibleInWindow be false or vice versa due to the isVisibleInWindow state of the view's parent view. Therefore, isVisibleInWindow represents the actual visible state of the view and isVisible is used to attempt to alter that state.


Defined in: statechart.js.
Default value:
false
SC.CoreView.UNATTACHED

The view has been created and rendered, but has not been attached (i.e. appended to the document).


Defined in: statechart.js.
SC.CoreView.UNRENDERED
The view has been created, but has not been rendered or attached.
Defined in: statechart.js.
Read Only
viewState String

The current state of the view as managed by its internal statechart.

In order to optimize the behavior of SC.View, such as only observing display properties when in a rendered state or queueing updates when in a non-shown state, SC.View includes a simple internal statechart that maintains the current state of the view.

Views have several possible states: SC.CoreView.UNRENDERED SC.CoreView.UNATTACHED SC.CoreView.ATTACHED_PARTIAL SC.CoreView.ATTACHED_SHOWING SC.CoreView.ATTACHED_SHOWN SC.CoreView.ATTACHED_SHOWN_ANIMATING SC.CoreView.ATTACHED_HIDING SC.CoreView.ATTACHED_HIDDEN SC.CoreView.ATTACHED_HIDDEN_BY_PARENT SC.CoreView.ATTACHED_BUILDING_IN SC.CoreView.ATTACHED_BUILDING_OUT SC.CoreView.ATTACHED_BUILDING_OUT_BY_PARENT


Defined in: statechart.js.
Default value:
SC.CoreView.UNRENDERED

Class Method Detail

applyLocalizedAttributes(loc)

Internal method actually updates the localized attributes on the view class. This is overloaded in design mode to also save the attributes.


Defined in: view.js.
Parameters:
loc
bind(keyName, path)
Helper adds a binding to a design
Defined in: view.js.
Parameters:
keyName
path
childView(cv)
Helper adds the childView
Defined in: view.js.
Parameters:
cv
classNames(sc)
Helper applies the classNames to the prototype
Defined in: view.js.
Parameters:
sc
create()

Create a new view with the passed attributes hash. If you have the Designer module loaded, this will also create a peer designer if needed.


Defined in: view.js.
design(attrs)

This method works just like extend() except that it will also preserve the passed attributes in case you want to use a view builder later, if needed.


Defined in: view.js.
Parameters:
attrs Hash
Attributes to add to view
Returns:
Class
SC.View subclass to create
extend()

Defined in: view.js.
layout(layout)
Helper applies the layout to the prototype.
Defined in: view.js.
Parameters:
layout
loc(loc, rootElement)

Applies the passed localization hash to the component views. Call this method before you call create(). Returns the receiver. Typically you will do something like this:

view = SC.View.design({...}).loc(localizationHash).create();


Defined in: view.js.
Parameters:
loc Hash
rootElement
{String} optional rootElement with prepped HTML
Returns:
SC.View
receiver
localization(attrs, rootElement)

Used to construct a localization for a view. The default implementation will simply return the passed attributes.


Defined in: view.js.
Parameters:
attrs
rootElement
prop(keyName, value)
Helper sets a generic property on a design.
Defined in: view.js.
Parameters:
keyName
value
tagName(tg)
Help applies the tagName
Defined in: view.js.
Parameters:
tg
viewFor(element, attrs)

Creates a view instance, first finding the DOM element you name and then using that as the root element. You should not use this method very often, but it is sometimes useful if you want to attach to already existing HTML.


Defined in: view.js.
Parameters:
element String|Element
attrs Hash
Returns:
SC.View
instance

Instance Method Detail

didTransitionIn(transition, options)

This method is called by transition plugins when the incoming or showing transition completes. You should only use this method if implementing a custom transition plugin.


Defined in: statechart.js.
Parameters:
transition SC.ViewTransitionProtocol
The transition plugin used.
options Object
The original options used. One of transitionShowOptions or transitionInOptions.
didTransitionOut(transition, options)

This method is called by transition plugins when the outgoing or hiding transition completes. You should only use this method if implementing a custom transition plugin.


Defined in: statechart.js.
Parameters:
transition SC.ViewTransitionProtocol
The transition plugin used.
options Object
The original options used. One of transitionHideOptions or transitionOutOptions.
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:20 GMT-0600 (CST)