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

Instance Methods

Field Detail

classNames Array
Default value:
['sc-static-content-view']
See:
SC.View#classNames
content String

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
displayProperties Array
Default value:
['content']
See:
SC.View#displayProperties

Instance Method Detail

contentLayoutDidChange()

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.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:21 GMT-0600 (CST)