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
- escapeHTML
- exampleEditor
- formatter
- hint
- icon
- inlineEditorDelegate
- localize
- needsEllipsis
- renderDelegateName
- textAlign Deprecated
- value
- Fields borrowed from SC.View:
- acceptsFirstResponder, acceptsMultitouch, ariaHidden, ariaRole, attributeBindings, autoMixins, backgroundColor, childViewLayout, childViewLayoutOptions, childViews, childViewsNeedLayout, classNameBindings, classNames, concatenatedProperties, createdByParent, designMode, displayProperties, 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, 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
- Fields borrowed from SC.Control:
- controlSize, errorLabel, fieldKey, fieldLabel, isActive, isControl, isSelected
Instance Methods
- autoResizeLayer()
- autoResizeText()
- displayHint()
- displayTitle()
- hintEnabled()
- hintValue()
- inlineEditorDidBeginEditing(original, editor, value, editable)
- inlineEditorDidEndEditing()
Field Detail
escapeHTML BooleanWhether 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
The exampleInlineTextFieldView
property is by default a
SC.InlineTextFieldView
but it can be set to a customized inline text field
view.
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.
The hint to display if no value is set. Should be used only if isEditable
is set to YES
.
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.
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.
If true, then the value will be localized. This is a default that can be overidden by the settings in the owner view.
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
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
The value of the label.
You may also set the value using a content object and a contentValueKey
.
Instance Method Detail
The hint that will actually be displayed depending on localization and sanitizing (or not).
The value that will actually be displayed.
This property is dynamically computed by applying localization, string conversion and other normalization utilities.
- Parameters:
- original
- editor
- value
- editable