fluid.render
This functionality is Sneak Peek status. This means that the APIs may change. We welcome your feedback, ideas, and code, but please use caution if you use this new functionality.
This page is still incomplete.
fluid.render()
A simple driver for single node self-templating. Parses the source into a template structure, renders it using the supplied component tree and options, replaces the markup in the target node with the rendered markup, and finally performs any required data binding.
fluid.render(source, target, tree, options);
File name: Renderer.js
Parameters
source |
(Object or String) Either a structure {node: node, armouring: armourstyle } or a string holding a literal template. See the source section below for more information. |
target |
(Node) The node to receive the rendered markup |
tree |
(Object) The component tree to be rendered |
options |
(Object) An options structure to configure the rendering and binding process. See the options section below for more information. |
Return Value
Object | A templates structure, suitable for a further call to fluid.reRender or fluid.renderTemplates |
See Also
Notes
The source
parameter
The source
parameter can either be a string holding a literal template or an object with the following structure:
{ node: <DOM node>, armouring: <boolean> }
The properties in the object are:
node |
This is a either a pure DOM node or a jQuery object wrapping a DOM node. |
armouring |
This boolean flag controls whether or not the node is treated as ...? (default: false ) |
Options
The options
parameter is an optional object containing key/value pairs that can configure how the Renderer works. Supported options are:
Field |
Description |
Type |
In/Out |
---|---|---|---|
|
Perhaps the most important parameter, contains the "data model" to which value bindings expressed within the tree will be expressed. |
free |
Mostly In, but the supplied model may be written to later as a result of servicing user actions, especially if the parameter |
|
a ChangeApplier object associated with the |
|
In |
|
If set, any user modification of fields with |
|
In |
|
If set, will cause the rendered ids to be uniquified against the supplied document, rather than the current one |
|
In |
|
If set, mismatches between template and component tree will be highlighted in an unreasonable garish pink colour |
|
In |
|
This map operates in conjunction with the |
free |
In/Out |
|
Configures the lookup from (I18N) messages referenced in the component tree, to some source of a message bundle |
|
In |
|
Will construct a |
|
In |
|
Will XMLEncode the rendered markup before insertion into the document. Can be useful for debugging |
|
In |
|
This is properly a directive to the parser, rather than the renderer, but the options structure is shared. This contains a list of pairs of |
Array of |
In |
Example
example here
In this example, description here...