Class: SC.StaticContentView
Extends
SC.View.
StaticContentView allows you to display arbitrary HTML content inside your view hierarchy.
Normally, views in SproutCore are absolutely positioned. Their width and
height are either pre-determined, or specified relative to their enclosing
view. Occasionally, you may want to display content that is laid out by
the browser. For example, if you were writing a documentation browser, you
may want to display the table of contents as an SC.ListView
, but the actual
pages as HTML content.
This class is most useful when placed inside a ScrollView.
To use it, simply set the content
property to a string of the HTML you
would like to display.
Defined in: static_content.js
- Since:
- SproutCore 1.2
Field Summary
- Fields borrowed from SC.View:
- acceptsFirstResponder, acceptsMultitouch, ariaHidden, ariaRole, attributeBindings, autoMixins, backgroundColor, childViewLayout, childViewLayoutOptions, childViews, childViewsNeedLayout, classNameBindings, concatenatedProperties, createdByParent, designMode, enabledState, firstKeyView, hasLayout, hasTouch, hasVisibility, isBuildingIn, isBuildingOut, isChildViewLayoutLive, isEnabled, isFixedHeight, isFixedPosition, isFixedSize, isFixedWidth, isKeyResponder, isTextSelectable, isView, isVisible, lastKeyView, layerLocationNeedsUpdate, layerNeedsUpdate, layout, modeAdjust, nextKeyView, page, pane, parentView, previousKeyView, renderDelegateName, shouldInheritCursor, shouldInheritEnabled, tagName, themeName, toolTip, touchBoundary, transitionAdjust, transitionAdjustOptions, transitionHide, transitionHideOptions, transitionIn, transitionInOptions, transitionOut, transitionOutOptions, transitionShow, transitionShowOptions, useStaticLayout
- Fields borrowed from SC.Responder:
- hasFirstResponder, isFirstResponder, responderContext
- Fields borrowed from SC.Object:
- isDestroyed, isObject, nextProperty, object, property, target, toInvalidate
- Fields borrowed from SC.Observable:
- isObservable
Instance Methods
Field Detail
classNames Array- Default value:
- ['sc-static-content-view']
- See:
- SC.View#classNames
The HTML content you wish to display. This will be inserted directly into the DOM, so ensure that any user-generated content has been escaped.
- Default value:
- null
- Default value:
- ['content']
- See:
- SC.View#displayProperties
Instance Method Detail
Because SproutCore has no way of knowing when the size of the content inside a StaticContentView has changed, you should call this method whenever an event that may change the size of the content occurs.
Note that if you change the content property, this will be recalculated automatically.