Log in
Log in with USB
Inloggen met vingerafdruk wordt binnenkort mogelijk.
Last change: July 2, 2020
Current version: 1.6.1
he showTemplate module uses an html template element to display data. The html from the template element is rendered with mustache and then added to the given html destination element.
webanizr.send('showTemplate', data, parameters, callback);
The data to use when parsing the data. When the following data is received:
{ firstname__person : "John", email__person : "john@whereismyemail.com" }
It can be used in a template:
<template id="mytemplate"> <p>Hello {{ firstname__person }}, your email address is {{ email__person }}.</p> </template>
Which will result in:
Hello John, your email address is john@whereismyemail.com.
The showTemplate accepts the following parameters:
The html id of the element to which to add the rendered html from the template.
The html id of the template containing the html that should be rendered.
Lets the module decode the given content before running it through mustache. The options for this parameter are:
Tells the module how to add the generated html to the dom element. Te options for this parameter are:
Function to check if the template has been rendered yet. The function has 5 tries, 300 miliseconds apart. If the template has not been rendered then, a log event is triggered. The function should return false if the template is not loaded far enough and true if the template has been rendered. The callback function will not be called untill the check function returns true.
The callback is called with the original data.
https://cdn.cpmodules.webanizr.com/demo/display-data-in-template/index.html
https://cdn.cpmodules.webanizr.com/demo/display-product-list/index.html