UNPKG

zpt

Version:

Zenon Page Templates - JS (ZPT-JS)

69 lines (59 loc) 3.02 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>ZPT-JS reference - Configuration - indexExpressions</title> <script type="text/javascript" src="../lib/zpt.min.js" defer></script> <script type="text/javascript" src="../js/zpt.js" defer></script> <script type="text/javascript" src="../lib/syntaxHighlighter/lib.js"></script> <link rel="stylesheet" type="text/css" href="../docs.css"> <link rel="stylesheet" type="text/css" href="../lib/syntaxHighlighter/theme.css"> </head> <body> <div data-use-macro="'page@templates.html'"> <div data-fill-slot="'page-header'"> <h1>ZPT-JS reference - Configuration - indexExpressions</h1> <ul> <li><a href="#syntax">Syntax</a>.</li> <li><a href="#description">Description</a>.</li> <li><a href="#examples">Examples</a>.</li> </ul> </div> <article data-fill-slot="'article'"> <h2 data-attributes="id 'syntax'">Syntax</h2> <pre class="syntax"> indexExpressions ::= Boolean </pre> <h2 data-attributes="id 'description'">Description</h2> <p> If <code>indexExpressions</code> is <code>true</code> ZPT-JS builds an index with all the expressions and their dependencies. This makes it easy a later <em>update</em> command. It is an boolean value. The default value is <code>true</code>. </p> <p> If it is <code>true</code> ZPT will add a <code>data-id</code> attribute to every tag with ZPT-JS attributes (a counter value starting by 1). It is needed by the index. </p> <p> You can set this value to <code>false</code> if you are not going to use <em>update</em> commands to improve performance. </p> <p> Important! This configuration option must be used beside a <a href="configuration-command.html">fullRender</a> command and previous to an <a href="configuration-command.html">update</a> command. It the command is not <em>fullRender</em> it will be ignored. The <em>update</em> command needs the index so it only works if this options is set to <code>true</code>. </p> <h2 data-attributes="id 'examples'">Examples</h2> <p> An example of ZPT-JS invokation using <em>indexExpressions</em>: </p> <pre class="brush: js; highlight: [12]"> "use strict"; var zpt = require( 'zpt' ); var dictionary = { ... }; zpt.run({ root: document.getElementById( 't1' ), dictionary: dictionary, indexExpressions: false }); </pre> </article> </div> </body> </html>