Section | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Parameters
...
componentContainer
The componentContainerSelector
componentContainer
parameter is a selector identifying , a single-element jQuery, or a DOM element specifying the root DOM node of the Inline Edit markup.
Anchor | ||||
---|---|---|---|---|
|
options
The options
parameter is an optional collection of name-value pairs that configure data structure that configures the Inline Edit components. The available options are component(s), as described below , with the addition of a selector for identifying the editable elements. The default selector is defined as follows:
...
selectors: {
editables: ".inlineEditable"
}
Creator
...
fluid.inlineEdit(componentContainerSelector, options);
Return: The Inline Edit component object.
Parameters
componentContainer
The componentContainerSelector
parameter is a selector, jQuery object, or DOM element representing the component's container.
...
options
The options
parameter is an optional collection of name-value pairs that configure the Inline Edit component:
...
Name
...
Description
...
Values
...
Default
...
selectors
...
Javascript object containing selectors for various fragments of the Inline Edit component.
...
The object can contain any subset of the following keys:
text
editContainer
edit
Any values not provided will revert to the default.
...
selectors: {
text: ".text",
editContainer: ".editContainer",
edit: ".edit"
}
...
styles
...
Javascript object containing CSS style names that will be applied to the Inline Edit component.
...
The object can contain any subset of the following keys:
invitation
defaultViewText
tooltip
focus
Any values not provided will revert to the default.
...
styles: {
invitation: "inlineEdit-invitation",
defaultViewText: "inlineEdit-invitation-text",
tooltip: "inlineEdit-tooltip",
focus: "inlineEdit-focus"
}
...
paddings
...
Javascript object containing pixed values that will configure the size of the edit field.
...
The object can contain any subset of the following keys:
edit
minimumEdit
minimumView
Any values not provided will revert to the default.
...
paddings: {
edit: 10,
minimumEdit: 80,
minimumView: 60
}
...
finishedEditing
...
A function that will be called each time the Inline Edit component leaves edit mode. This function can be used to communicate changes in the field to the server, or to take any other action desired by the implementor.
...
a function
...
finishedEditing: function () {
}
...
editModeInjector
...
A function that creates the editable field based on the display text. This function is used if no edit container is provided in the markup.
...
a function
...
in the fluid:Options section.
...
Anchor | ||||
---|---|---|---|---|
|
Supported Events
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 | ||||
---|---|---|---|---|
|
Include Page | ||||||
---|---|---|---|---|---|---|
|
...
Skinning
This component can be skinned "out of the box" when you include the component's CSS files. Just be sure to put the following in your document:
Code Block | ||||
---|---|---|---|---|
| ||||
<link rel="stylesheet" type="text/css" href="components/inlineEdit/css/InlineEdit.css" />
|
...
Dependencies
The Inline Edit dependencies can be met by including the minified InfusionAll.js
file in the header of the HTML file:
Code Block | ||||
---|---|---|---|---|
| ||||
|
...
<script |
...
type= |
...
"text |
...
/ |
...
selectOnEdit
...
Indicates whether or to automatically selected the editable text when the component switches into edit mode.
...
boolean
...
false
...
defaultViewText
...
The default text to use when filling in an empty component. Set to empty to suppress this behaviour
...
string
...
"Click here to edit"
...
useTooltip
...
Indicates whether or not the component should display a custom ("invitation") tooltip on mouse hover
...
boolean
...
false
...
tooltipText
...
The text to use for the tooltip to be displayed when hovering the mouse over the component
...
string
...
"Click item to edit"
...
tooltipId
...
The id to be used for the DOM node holding the tooltip
...
string
...
"tooltip"
...
tooltipDelay
...
The delay, in ms, between starting to hover over the component and showing the tooltip
...
number
...
2000
Functions
...
fluid.inlineEdit.edit();
Switches the component into edit mode.
...
fluid.inlineEdit.finish();
...
javascript" src="InfusionAll.js"></script>
|
Alternatively, the individual file requirements are:
Include Page | ||||||
---|---|---|---|---|---|---|
|