Section | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Creating Multiple Inline Edits
Code Block | |||
---|---|---|---|
javascript | javascript|||
fluid.inlineEdits(componentContainer, options);
|
Return: An array of the Inline Edit component objects.
This function will find any elements within the given container that are identified as 'editables' and apply the Inline Edit component to them.
Parameters
componentContainer
...
The options
parameter is an optional data structure that configures the Inline Edit component(s), as described below in the fluid:Options section.
...
Anchor | ||||
---|---|---|---|---|
|
...
The Inline Edit component fires the following events (for more information about events in the Fluid Framework, see Events for Component Users):
Include Page | ||||
---|---|---|---|---|
|
Include Page |
---|
Functions
These functions are defined on the central that
object returned from the inlineEdit construction function - for example with
...
var that = fluid.inlineEdit(componentContainer, options);
...
that.edit();
Switches the component into edit mode. The events onBeginEdit
and afterBeginEdit
will fire.
...
that.finish();
Switches the component out of edit mode into display mode, updating the displayed text with the current content of the edit field. The events onFinishEdit
and afterFinishEdit
will fire. If the model value has changed, there will be a call to modelUpdated
in between these calls.
...
that.refreshView(source);
Updates the state of the inline editor in the DOM, based on changes that may have happened to the model.
...
that.tooltipEnabled();
Returns a boolean indicating whether or not the tooltip is enabled.
...
that.updateModel(newValue, source);
Updates the component's internal representation of the text to a new value. If the value differs from the existing value, the modelChanged
event will fire and the component will be re-rendered.
...
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.
...
Options
The following options to the creator functions can be used to customize the behaviour of the Inline Edit component:
Include Page | |||
---|---|---|---|
|
Include Page | ||||||
---|---|---|---|---|---|---|
|
The options for the creation of multiple Inline Edits are the same as those for the creation of a single Inline Edit, with the addition of a selector for identifying the editable elements. The default selector is defined as follows:
...
...
selectors: {
editables: ".inlineEditable"
}
...
Skinning
This component can be skinned "out of the box" when you include our the component's CSS skin files. Just be sure to put the following in you your document:
Code Block | ||||
---|---|---|---|---|
| ||||
<link rel="stylesheet" type="text/css" href="css/fluid.layout.css" /> <link rel="stylesheet" type="text/css" href="css/fluid.states.css" /> <link rel="stylesheet" type="text/css" href="css/fluid.theme.mist.css" /> <link rel="stylesheet" type="text/css" href="css/fluid.theme.hc.components/inlineEdit/css/InlineEdit.css" /> |
and to attatch a class attribute that represents the skin you want to the components container, such as:
...
<div id="inlineEditContainer" class="fl-theme-mist">
...
</div>
...
The above code would make use of the theme.mist.css skin file.
Dependencies
The Inline Edit dependencies can be met by including the minified Fluid-allInfusionAll.js
file in the header of the HTML file:
Code Block | ||||
---|---|---|---|---|
| ||||
<script type="text/javascript" src="Fluid-allInfusionAll.js"></script> |
Alternatively, the individual file requirements are:
Include Page |
---|
...
|