Mixin: SC.InlineEditorDelegate
This delegate is consulted by view implementing SC.InlineEditable
and
SC.InlineEditor
and controls the lifecycle of the editor as well as begin
notified of events in the editing process.
By default it edits an SC.LabelView
using an SC.InlineTextFieldView.
All methods will be attempted to be called on the inlineEditorDelegate
of the
inlineEditor
or inlineEditable
first and then the target view if it didn't exist
on the delegate. This allows you to implement default delegate handlers on your
editable view.
Defined in: inline_editor_delegate.js
- Since:
- SproutCore 1.0
Class Methods
- acquireEditor(editable)
- inlineEditorDidBeginEditing(editor, value, editable)
- inlineEditorDidCommitEditing(editor, value, editable)
- inlineEditorDidDiscardEditing(editor, editable)
- inlineEditorShouldBeginEditing(editable, value)
- inlineEditorShouldCommitEditing(editor, value, editable)
- inlineEditorShouldDiscardEditing(editor, editable)
- inlineEditorWillBeginEditing(editor, value, editable)
- inlineEditorWillCommitEditing(editor, value, editable)
- inlineEditorWillDiscardEditing(editor, editable)
- releaseEditor(editor)
Class Method Detail
Acquires an editor for the view. This may simply create one and return it, or you may implement more complex lifecycle management like pooling of editors.
May return null if for some reason an editor could not be required.
You must override this function.
- Parameters:
- editable
- Returns:
- SC.InlineEditor
- an editor for the view
Notifies the delegate that the editor has finished setting up itself and is now editing.
- Parameters:
- editor
- value
- editable
Notifies the delegate that the editor was allowed to commit and finished performing any cleanup necessary. This is where you should save the final value back to your view after performing any necessary transforms to it.
- Parameters:
- editor
- value
- editable
Notifies the delegate that the editor has finished cleaning up after discarding editing.
- Parameters:
- editor
- editable
Determines if the view should be allowed to begin editing and returns YES
if
so. Isn't passed the editor because it hasn't been created yet. If this
method is not defined the editor will assume it is always allowed to begin
editing.
- Parameters:
- editable
- value
- Returns:
- Boolean
- YES if the view is allowed to edit
Determines if the editor is allowed to end editing and store its value back to the view being edited. If this method is not defined the editor will assume it is always allowed to commit.
- Parameters:
- editor
- value
- editable
Determines if the editor is allowed to discard its current value and end editing. If this method is undefined the editor will assume it is always allowed to discard.
- Parameters:
- editor
- editable
Notifies the delegate that the view was allowed to begin editing and the editor has been acquired, but hasn't actually done any setup. Most views will set their current value as the starting value of the editor here, and depending on the editor other configuration options may be available.
Since the editor's value hasn't been configured with, the value passed here will be the default value of the editor.
- Parameters:
- editor
- value
- editable
Notifies the delegate that the editor was allowed to commit and is going to commit but hasn't actually performed any cleanup yet.
- Parameters:
- editor
- value
- editable
Notifies the delegate that the view was allowed to discard editing but hasn't performed any cleanup yet.
- Parameters:
- editor
- editable
Releases an editor. This may simply remove it from its parent and dispose of it, or you may implement more complex lifecycle management like pooling of editors.
You must override this function.
- Parameters:
- editor
- Returns:
- Boolean
- YES if it was successfully released