Class: FluentDOM

WinJSContrib.UI. FluentDOM

new FluentDOM(nodeType, className, parentElt, parent)

Utility class for building DOM elements through code with a fluent API

Parameters:
Name Type Description
nodeType string

type of DOM node (ex: 'DIV')

className

css classes

parentElt

parent DOM element

parent WinJSContrib.UI.FluentDOM

parent FluentDOM

Source:
Example
var elt = new WinJSContrib.UI.FluentDOM('DIV', 'item-content')
   .text(item.title)
   .display('none')
   .element;

Methods

addClass(classname) → {WinJSContrib.UI.FluentDOM}

Add a css class

Parameters:
Name Type Description
classname

css class

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

append(nodeType, className, callback) → {WinJSContrib.UI.FluentDOM}

create a child FluentDOM and append it to current

Parameters:
Name Type Description
nodeType

child node type

className

css classes

callback

callback receiving the new FluentDOM as an argument

Source:
Returns:

current instance (for method chaining)

Type
WinJSContrib.UI.FluentDOM

appendTo(elt) → {WinJSContrib.UI.FluentDOM}

append element to another DOM element

Parameters:
Name Type Description
elt

parent element

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

attr(name, val) → {WinJSContrib.UI.FluentDOM}

set attribute

Parameters:
Name Type Description
name

attribute name

val

attribute value

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

className(classname) → {WinJSContrib.UI.FluentDOM}

set className

Parameters:
Name Type Description
classname

css classes

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

createChild(nodeType, className) → {WinJSContrib.UI.FluentDOM}

create a child FluentDOM and append it to current

Parameters:
Name Type Description
nodeType

child node type

className

css classes

Source:
Returns:

child FluentDOM

Type
WinJSContrib.UI.FluentDOM

ctrl(ctrl, options) → {WinJSContrib.UI.FluentDOM}

create a WinJS control

Parameters:
Name Type Description
ctrl

constructor or full name of the control

options

control options

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

display(display) → {WinJSContrib.UI.FluentDOM}

set display

Parameters:
Name Type Description
display

display

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

hide() → {WinJSContrib.UI.FluentDOM}

set display 'none'

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

html(text) → {WinJSContrib.UI.FluentDOM}

set innerHTML

Parameters:
Name Type Description
text

text

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

opacity(opacity) → {WinJSContrib.UI.FluentDOM}

set opacity

Parameters:
Name Type Description
opacity

opacity

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

style(name, val) → {WinJSContrib.UI.FluentDOM}

set style property

Parameters:
Name Type Description
name

attribute name

val

attribute value

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

style(name, val) → {WinJSContrib.UI.FluentDOM}

set style property

Parameters:
Name Type Description
name

attribute name

val

attribute value

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

tap(callback, options) → {WinJSContrib.UI.FluentDOM}

add tap behavior

Parameters:
Name Type Description
callback

tap callback

options

tap options

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

text(text) → {WinJSContrib.UI.FluentDOM}

set textContent

Parameters:
Name Type Description
text

text

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM

visibility(visibility) → {WinJSContrib.UI.FluentDOM}

set visibility

Parameters:
Name Type Description
visibility

visibility

Source:
Returns:
Type
WinJSContrib.UI.FluentDOM