fluid.defaults(global, componentName, defaults) Section |
---|
Column |
---|
| Centrally stores and retrieves a component's default settings. Code Block |
---|
| javascript |
---|
| javascript |
---|
bgColor | white |
---|
borderStyle | nonejavascript |
---|
|
fluid.defaults(global, componentName, defaults);
|
File name: Fluid.js Parameters Span |
---|
| global | (boolean) Optional: If true, manipulate a global option (for the head component) rather than instance options. Note that this is deprecated as of v1.3 | componentName | (String) the name of the component | defaults | (Object) a container of key/value pairs to set. See #Defaults Structure below for information about the format of this object. |
|
Return Value Span |
---|
| Object | If the object is passed in the argument, this is added to the store and then returned. If not, the current object in the store is returned. |
|
|
| NotesDefaults StructureThe defaults object ... Span |
---|
| Code Block |
---|
|
{
option1: <default value for option one>,
option2: {
subOpt1: <default for sub-option1>,
subOpt2: <default for sub-option1>
}
}
|
| The array of arguments can contain references to... |
|
Example Code Block |
---|
|
fluid.defaults("inlineEdit", {
selectors: {
text: ".text",
editContainer: ".editContainer",
edit: ".edit"
},
|
In this example, the default selectors(text, editContainer, edit) for inlineEdit are set to the element with the following classes respectively, text, editContainer, edit. As the componenent's creator starts up, it will merge together the user's instance options to produce its runtime options. |