Class

RezStackLayout

RezStackLayout()

Constructor

# new RezStackLayout()

A layout that holds a list of content blocks rendered in sequence.

Content blocks are rendered in order (or reversed order if layout_reverse is set on the source) and joined with an optional separator.

Source element attributes:

  • layout_reverse: If true, new content is added to the front
  • layout_separator: HTML string inserted between content blocks

View Source rez_view.js, line 659

Extends

Members

boolean

# reversed

Whether content should be added in reverse order.

View Source rez_view.js, line 703

Methods

# addContent(block)

Adds a content block to the layout.

If reversed, adds to the front; otherwise adds to the back.

Parameters:
Name Type Description
block RezBlock

The content block to add

Overrides:

View Source rez_view.js, line 714

# bindAs() → {string}

Returns the binding name for this layout.

Overrides:

View Source rez_view.js, line 694

The block type as binding name

string

# bindBlocks() → {Object}

Renders all nested blocks to HTML.

Inherited From:

View Source rez_view.js, line 399

Map of binding names to rendered HTML strings

Object

# bindValues() → {Object}

Creates the complete value bindings for template rendering.

Combines parent bindings with this block's bindings, adding:

  • block: Reference to this block
  • params: The params object
  • source: The source element
  • Source's bindAs name: The source element (aliased)
Inherited From:

View Source rez_view.js, line 360

Complete bindings object for template rendering

Object

# bindings() → {Object}

Computes complete bindings including values and rendered blocks.

Inherited From:

View Source rez_view.js, line 430

Complete bindings object

Object

# copy() → {RezStackLayout}

Creates a copy of this layout including all content blocks.

Overrides:

View Source rez_view.js, line 745

A new layout with copied content

# css_classes() → {string}

Gets the CSS classes for this block's wrapper element.

Inherited From:

View Source rez_view.js, line 456

If block type is not recognized

Error

Space-separated CSS class names

string

# dereferenceBoundValue(value) → {Object|Array.<Object>}

Dereferences element references to their actual elements.

Handles both single values and arrays of values.

Parameters:
Name Type Description
value string | Object | Array

Value(s) to dereference

Inherited From:

View Source rez_view.js, line 311

The dereferenced element(s)

Object | Array.<Object>

# extractBindingValue(bindings, source, derefopt) → {*}

Extracts a value from a binding source.

Supports multiple source types:

  • String: Treated as an element ID
  • Element reference ({$ref: "id"}): Resolved to the element
  • Function: Invoked with block context
  • Object with binding function: Path-based resolution
Parameters:
Name Type Attributes Default Description
bindings Object

Current bindings object

source string | function | Object

The binding source

deref boolean <optional>
false

Whether to dereference the result

Inherited From:

View Source rez_view.js, line 279

If source type is not recognized

Error

The extracted value

*

# getBindings(initialBindings) → {Object}

Builds the bindings object from the source element's bindings attribute.

Processes each binding specification, resolving sources to values and adding them to the bindings object with their specified prefixes.

Parameters:
Name Type Description
initialBindings Object

Initial bindings to extend

Inherited From:

View Source rez_view.js, line 328

The complete bindings object

Object

# getBlocks() → {Object}

Retrieves and instantiates nested blocks from the source's blocks attribute.

Each block specification defines a binding name and source element. The blocks are instantiated as RezBlock instances with this block as parent.

Inherited From:

View Source rez_view.js, line 380

Map of binding names to RezBlock instances

Object

# getViewTemplate() → {function}

Gets the view template function for this block.

Inherited From:

View Source rez_view.js, line 408

Template function that accepts bindings and returns HTML

function

# html() → {string}

Renders this layout to HTML.

Renders content first, then applies the layout's template with the content and all bindings.

Inherited From:

View Source rez_view.js, line 564

Complete HTML for this layout

string

# instantiateBindingPath(p) → {*}

Resolves a binding path function against the source.

Parameters:
Name Type Description
p function

Path function to invoke

Inherited From:

View Source rez_view.js, line 218

The resolved value

*

# instantiateFunctionBinding(bindings, f) → {*}

Invokes a function binding with the current context.

Parameters:
Name Type Description
bindings Object

Current bindings object

f function

The function to invoke

Inherited From:

View Source rez_view.js, line 204

The function's return value

*

# instantiateIdBinding(id) → {Object}

Resolves an element ID to its corresponding game element.

Parameters:
Name Type Description
id string

The element ID to resolve

Inherited From:

View Source rez_view.js, line 180

The resolved game element

Object

# instantiatePathBinding(path_fn, bindings) → {*}

Resolves a path binding function with current bindings.

Parameters:
Name Type Description
path_fn function

Path function to invoke

bindings Object

Current bindings object

Inherited From:

View Source rez_view.js, line 229

The resolved value

*

# instantiatePropertyBinding(ref) → {*}

Resolves a property reference to its value.

Parameters:
Name Type Description
ref Object

Property reference with elem_id and attr_name

elem_id string

The element ID

attr_name string

The attribute name to read

Inherited From:

View Source rez_view.js, line 192

The attribute value

*

# parentBindings() → {Object}

Gets bindings from the parent block, if any.

Inherited From:

View Source rez_view.js, line 417

Parent bindings or empty object

Object

# renderBlock() → {string}

Renders the block content using its template and bindings.

Inherited From:

View Source rez_view.js, line 444

Rendered HTML content

string

# renderContents() → {string}

Renders all content blocks to HTML.

Blocks are joined with the layout_separator if specified.

Overrides:

View Source rez_view.js, line 731

Rendered content HTML

string

# resolveBindingValue(bindings, bindingObject) → {*}

Resolves a binding object to its actual value.

Handles literal values directly, otherwise delegates to extractBindingValue for source-based resolution.

Parameters:
Name Type Attributes Description
bindings Object

Current bindings object

bindingObject Object

The binding specification

literal * <optional>

A literal value (used directly if present)

source * <optional>

Source for value resolution

deref boolean <optional>

Whether to dereference the result

Inherited From:

View Source rez_view.js, line 247

If source is undefined or null when no literal is provided

Error

The resolved binding value

*

# static constructor(sourceName, source)

Creates a new RezStackLayout.

Parameters:
Name Type Description
sourceName string

The block type name

source Object

The source element for this layout

View Source rez_view.js, line 676