Appframe Knowledge Base


1 hits
1

Repeater / Template Syntax

<!-- Everything inside <% %> is JavaScript, so you can use variables and if statements.
     If you want to use values from the current row, you can use the variable "row".
     If you want to have logic based on the row index, "i" is the zero based index.
     If you want to have logic based of the previous or next row, "data" is the array of rows. -->

<%if (row.SomeBitField === true) {%>
	<p>The variable is true</p>
<%} else {%>
	<p>The variable is not true</p>
<%}%>

<!-- Normally if you just want the escaped value of a field, you use this syntax: -->

<p><%=MyFieldName%></p>

<!-- If you need to replace something or process the value, you need to prefix the field name
     with "row.", as the un-prefixed version is only a shorthand that escapes for you.
     Make sure you escape the value before outputting it when using row.FieldName: -->

<p><%=af.common.htmlEscape(row.SomeField.replace("foo", "bar"))%></p>
<p><%=af.common.stringifyValue(row.FieldA || row.FieldB)%></p>

components web · Perma link post comment Posted by: Martin Vaaden (11-jun-2014)