Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Event

Type

Description

Parameters

Parameter Description

modelChanged

default

This event is fired any time the model for the component has changed, that is, any time the value of the text associated with the component has changed.

(model, oldModel, source)

model: The current (new) value of the "model" structure representing the editable state of the component
{{oldModel}}: A snapshot of the old value of the model structure before the current edit operation started
{{source}}: An arbitrary object which optionally represents the "source" of the change, which can be checked by listeners to prevent cyclic events. Can often be undefined.

onBeginEdit

"preventable"

This event fires just before the component switches from 'view' mode into 'edit' mode. Because the event is preventable, listeners may prevent the component from actually entering edit mode.

none

 

afterBeginEdit

default

This event fires just after the component has finished entering 'edit' mode.

none

 

onFinishEdit

"preventable"

This event fires just before the component switches out of 'edit' mode, i.e. before the newly edited value is stored in the model. Because the event is preventable, listeners may prevent the new value from being stored in the model, i.e. they may cancel the edit.

(newValue, oldValue, editNode, viewNode)

newValue, oldValue: see parameters for modelChanged
editNode: A DOM node which holds the concrete editable control - this may vary in interpretation for different embodiments of the InlineEdit control but may, for example be an <input>, <textarea> or <select> node,
viewNode: A DOM node which holds the read-only representation of the editable value.

afterFinishEdit

default

This event fires just after the newly edited value is stored in the model. Note that it only fires if the onFinishEdit event did not prevent the new value from being stored in the model.

newValue, oldValue, editNode, viewNode

(newValue, oldValue, editNode, viewNode): See description for onFinishEdit

...

Functions

These functions are defined on the central that object returned from the inlineEdit construction function - for example with

Code Block
javascript
javascript

var that = fluid.inlineEdit(componentContainer, options);
Code Block
javascript
javascript

that.edit();

Switches the component into edit mode. The events onBeginEdit and afterBeginEdit will fire.

Code Block
javascript
javascript
fluidthat.inlineEdit.finish();

Switches the component out of edit mode into display mode, updating the displayed text with the current content of the edit field. Calls the finishedEditing() function provided in the options, if it exists. NOTE that finishedEditing() is deprecated as of version 0.6, and will be removed entirely in version 0.9.. The events onFinishEdit and afterFinishEdit will fire. If the model value has changed, there will be a call to modelUpdated in between these calls.

Code Block
javascript
javascript
fluidthat.inlineEdit.renderrefreshView(source);

Prompts the component to render itselfUpdates the state of the inline editor in the DOM, based on changes that may have happened to the model.

Code Block
javascript
javascript
fluid.inlineEditthat.tooltipEnabled();

Returns a boolean indicating whether or not the tooltip is enabled.

Code Block
javascript
javascript
fluid.inlineEditthat.updateModel(newValue, source);

Updates the component's internal representation of the text to a new value. The If the value differs from the existing value, the modelChanged event will fire and the component will be re-rendered.

Code Block
javascript
javascript

that.model

Not a function, but a data structure. This directly represents the "model" or state of the editable component. External users should consider this structure as read-only, and only make modifications through the updateModel call above.

...

Anchor
optionsdesc
optionsdesc

...