ZPT-JS reference - Configuration - indexExpressions

Syntax

indexExpressions ::= Boolean
                

Description

If indexExpressions is true ZPT-JS builds an index with all the expressions and their dependencies. This makes it easy a later update command. It is an boolean value. The default value is true.

If it is true ZPT will add a data-id attribute to every tag with ZPT-JS attributes (a counter value starting by 1). It is needed by the index.

You can set this value to false if you are not going to use update commands to improve performance.

Important! This configuration option must be used beside a fullRender command and previous to an update command. It the command is not fullRender it will be ignored. The update command needs the index so it only works if this options is set to true.

Examples

An example of ZPT-JS invokation using indexExpressions:

"use strict";

var zpt = require( 'zpt' );

var dictionary = {
    ...
};

zpt.run({
    root: document.getElementById( 't1' ),
    dictionary: dictionary,
    indexExpressions: false
});