Class: SC.LabelView


Extends SC.Control, SC.InlineEditable, SC.InlineEditorDelegate, SC.View.

Displays a static string of text.

You use a label view anytime you need to display a static string of text or to display text that may need to be edited using only an inline control.

Defined in: label.js

Since:
SproutCore 1.0

Field Summary

Instance Methods

Field Detail

escapeHTML Boolean

Whether the value, hint and toolTip will be escaped to avoid HTML injection attacks or not.

You should only disable this option if you are sure you are displaying non-user generated text.

Note: this is not an observed display property. If you change it after rendering, you should call displayDidChange on the view to update the layer.

Default value:
true
exampleEditor

The exampleInlineTextFieldView property is by default a SC.InlineTextFieldView but it can be set to a customized inline text field view.

formatter

Set this to a validator or to a function and the value will be passed through it before being set.

This is a default default that can be overidden by the settings in the owner view.

hint

The hint to display if no value is set. Should be used only if isEditable is set to YES.

icon

An optional icon to display to the left of the label. Set this value to either a CSS class name (for spriting) or an image URL.

inlineEditorDelegate SC.Object

The delegate that gets notified of events related to the editing process. Set this to the object you want to handles the lifecycle of the inline editor.

Defaults to itself.

localize

If true, then the value will be localized. This is a default that can be overidden by the settings in the owner view.

needsEllipsis Boolean

If set to true, the label element will include the 'ellipsis' class, which by default sets the 'white-space' style to 'nowrap' and the 'text-overflow' style to 'ellipsis'.

Note: that this does NOT work with multi-line text.

Note: this is not an observed display property. If you change it after rendering, you should call displayDidChange on the view to update the layer.

Default value:
false
renderDelegateName String
The name of the theme's SC.LabelView render delegate.
Deprecated: Use CSS instead.
textAlign String SC.ALIGN_LEFT|SC.ALIGN_CENTER|SC.ALIGN_RIGHT

Set the alignment of the label view.

Note: this is not an observed display property. If you change it after rendering, you should call displayDidChange on the view to update the layer.

Default value:
null
value

The value of the label.

You may also set the value using a content object and a contentValueKey.

Instance Method Detail

autoResizeLayer()
autoResizeText()
displayHint()

The hint that will actually be displayed depending on localization and sanitizing (or not).

displayTitle()

The value that will actually be displayed.

This property is dynamically computed by applying localization, string conversion and other normalization utilities.

hintEnabled()
hintValue()
inlineEditorDidBeginEditing(original, editor, value, editable)
Parameters:
original
editor
value
editable
inlineEditorDidEndEditing()
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:20 GMT-0600 (CST)