Class: SC.CoreView
Defined in: base.js
Field Summary
- SC.CoreView.ATTACHED_BUILDING_IN
- SC.CoreView.ATTACHED_BUILDING_OUT
- SC.CoreView.ATTACHED_BUILDING_OUT_BY_PARENT
- SC.CoreView.ATTACHED_HIDDEN
- SC.CoreView.ATTACHED_HIDDEN_BY_PARENT
- SC.CoreView.ATTACHED_HIDING
- SC.CoreView.ATTACHED_PARTIAL
- SC.CoreView.ATTACHED_SHOWING
- SC.CoreView.ATTACHED_SHOWN
- SC.CoreView.ATTACHED_SHOWN_ANIMATING
- SC.CoreView.DISABLED
- SC.CoreView.DISABLED_AND_BY_PARENT
- SC.CoreView.DISABLED_BY_PARENT
- SC.CoreView.ENABLED
- SC.CoreView.IS_ATTACHED
- SC.CoreView.IS_DISABLED
- SC.CoreView.IS_HIDDEN
- SC.CoreView.IS_RENDERED
- SC.CoreView.IS_SHOWN
- isAttached
- isVisibleInWindow
- SC.CoreView.UNATTACHED
- SC.CoreView.UNRENDERED
- viewState
Class Methods
- applyLocalizedAttributes(loc)
- bind(keyName, path)
- childView(cv)
- classNames(sc)
- create()
- design(attrs)
- extend()
- layout(layout)
- loc(loc, rootElement)
- localization(attrs, rootElement)
- prop(keyName, value)
- tagName(tg)
- viewFor(element, attrs)
Instance Methods
Field Detail
SC.CoreView.ATTACHED_BUILDING_INThe 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.
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.
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.
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.
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.
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.
The view has been created and rendered and attached to a parent, but an ancestor is not attached.
Defined in: statechart.js.
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.
The view has been created, rendered and attached and is visible in the display.
Defined in: statechart.js.
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.
The view is disabled itself and is also disabled in the pane due to a disabled ancestor.
Defined in: enabled.js.
The view is enabled itself, but is effectively disabled in the pane due to a disabled ancestor.
Defined in: enabled.js.
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.
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.
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.
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.
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
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
The view has been created and rendered, but has not been attached (i.e. appended to the document).
Defined in: statechart.js.
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
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
Defined in: view.js.
- Parameters:
- keyName
- path
Defined in: view.js.
- Parameters:
- cv
Defined in: view.js.
- Parameters:
- sc
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.
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
Defined in: view.js.
Defined in: view.js.
- Parameters:
- layout
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
Used to construct a localization for a view. The default implementation will simply return the passed attributes.
Defined in: view.js.
- Parameters:
- attrs
- rootElement
Defined in: view.js.
- Parameters:
- keyName
- value
Defined in: view.js.
- Parameters:
- tg
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.
Instance Method Detail
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.
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.