Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:class=} h1.
Wiki Markup
Div
classapi-page

fluid.defaults(global,

componentName,

defaults)

{section} {column:width=70%} Centrally stores and retrieves a

Section
Column
width70%

Centrally stores and retrieves a component's

default

settings.

{

Code Block
:javascript|borderStyle=none|bgColor=white}
javascript
bgColorwhite
borderStylenone
javascript

fluid.defaults(global, componentName, defaults);
{code} *

File

name:

* {{

Fluid.js

}} h2. Parameters {span:class=borderless-table} | {{{*}global{*}}} | (boolean) Optional: If true, manipulate a global option (for the head component) rather than instance options. {color:purple}Note that this is deprecated as of v1.3{color} | | {{{*}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. | {span} h2. Return Value {span:class=borderless-table} | *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. | {span} {column} {column:width=5%} {column} {column} h3. See Also * [Fluid Component API] * [fluid.mergeComponentOptions] * [Fluid Component Options|Infusion13:Fluid Component API#Options] {column} {section} ---- h3. Notes h4. Defaults Structure The defaults object ... {span:class=borderless-table} | {code:javascript}

Parameters

Span
classborderless-table

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
classborderless-table

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.

Column
width5%

Column

See Also


Notes

Defaults Structure

The defaults object ...

Span
classborderless-table
Code Block
javascript
javascript

{
    option1: <default value for option one>,
    option2: {
        subOpt1: <default for sub-option1>,
        subOpt2: <default for sub-option1>
    }
}

{code} | The array of arguments can contain references

The array of arguments can contain references to...

| {span} h3. Example {code:javascript}

Example

Code Block
javascript
javascript

fluid.defaults("inlineEdit", {
    selectors: {
        text: ".text",
        editContainer: ".editContainer",
        edit: ".edit"
},
{code}

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.

{div}