Delegate: SC.InlineTextFieldDelegate

This is the default InlineEditorDelegate for SC.LabelView. The default editor is an SC.InlineTextFieldView.

Only one editor is allowed to be active at a time. If another view requests an editor while an editor is already active, the delegate will first attempt to commit the existing editor, then discard it if commit fails, and fail to acquire if the active editor could not be discarded.

Each time an editor is required, it instantiates it and appends it to the same parentView as the view being edited. The editor is responsible for positioning itself correctly in its beginEditing method.

Defined in: inline_text_field.js

Since:
SproutCore 1.0

Field Summary

  • SC.InlineTextFieldDelegate.editor

Class Methods

Field Detail

SC.InlineTextFieldDelegate.editor SC.InlineTextFieldView
The current shared inline editor.

Class Method Detail

acquireEditor(label)

If an editor is currently active, dismisses it by first attempting to commit and if that fails attempting to dismiss. If that fails, the acquire fails and returns null.

Otherwise, it creates the editor as a child of the client view's parentView and returns it.

The default editor is an SC.InlineTextFieldView. The client view may customize this by setting a different inlineEditor as its exampleEditor property.

Parameters:
label SC.InlineEditable
the label that is requesting an editor
Returns:
SC.InlineEditor
the editor the label should use to edit
releaseEditor(editor)

Cleans up the given editor by simply destroying it, which removes it from the view hierarchy. The client view should null any references to the editor so it may be garbage collected.

Parameters:
editor
Returns:
Boolean
whether the cleanup succeeded
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:20 GMT-0600 (CST)