This documentation is currently being moved to our new documentation site.

Please view or edit the documentation there, instead.

If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki.

Skip to end of metadata
Go to start of metadata


The Preview subcomponent is used by Full Page UI Options (with Preview) to ...

Do not use this component directly. The information on this page should be use when customizing Full Page UI Options (with Preview).

See Also
Full Page UI Options (with Preview)
User Interface Options API
Full Page UI Options

#Supported Events

#onReady
Fires when the Preview is ready.

#Methods

#updateModel(that, selections)
Used to update the model of the preview window's UI Enhancer.

#Options

listeners
See #Supported Events for information.

#templateUrl
Path to the template for the preview.

Supported Events

back to top

Listeners can be attached to any supported events through a component's listeners option. Values can be a function reference (not a string function name) or an anonymous function definition, as illustrated below:
var myComponent = component.name("#myContainerID", {
    listeners: {
        eventName1: functionName,
        eventName2: function (params) {
            ...
        }
    }
});

For information on the different types of events, see Infusion Event System.

onReady

Description

This event is fired when the preview template page has loaded.

Type

default

Parameters

none

Availability

Infusion v1.4

Methods

back to top

This component has public methods that can be invoked by integrators as necessary. These methods are typcially implemented as Invokers, which resolve their arguments from the environment at invocation time. These methods can be configured by the integrator if necessary: arguments can be changed, and in fact the entire implementation function can be replaced by a custom function (though it is likely rare that this would be necessary or desirable).

Configuration of invokers should be carried by creating a grade, using the following pattern:

fluid.defaults("<new name of overriding grade>", {
    gradeNames: ["<name of grade being overridden", "autoInit"],
    invokers: {
        <invokerName>: {
            funcName: <implementation function name>,
            args: [<array of argument specifications>]
        }
    }
});

Example of overriding an invoker

The Infusion Pager component has a method called {{acquireDefaultRange}} which, by default, simply returns the total range. An integrator may wish to override this using their own custom function:

fluid.defaults("my.pager", {
    gradeNames: ["fluid.pager", "autoInit"],
    invokers: {
        acquireDefaultRange: {
            funcName: "my.pager.acquireDefaultRange
        }
    }
});

updateModel(that, selections)

Description

Used by the component to filter a list of headings. The default implementation filters the list based on visibility.

Parameters

that
The preview component

selections
The current user settings

Configurable

yes
Default implementation: "fluid.tableOfContents.filterHeadings"
Default arguments:

[
    "{preview}",
    "{uiOptions}.model.selections"
]

Availability

Infusion v1.4

Options

back to top

templateUrl

Description

Path to the HTML file that will be displayed as the preview.

Default

"UIOptionsPreview.html"

Example

templateUrl: "../templates/PreviewTemplate.html"
  • No labels