nathanw
01/27/2021, 8:53 PMvar items = getBulkItems(parameters);
renderer.addCustomDataSource({
alias: "ITEMS",
format: render.DataSource.JSON,
data: JSON.stringify(items)
});
The items
I am passing in looks like this
var items = { 'items': [], 'units': units }; // Array items is populated later
I am able to get and render the Array of Items in the template using,
<table style="width: 100%; margin-top: 5px;" colspan="10">
<#if ITEMS?has_content>
<#list ITEMS.items as item>
<#if item_index==0>
<thead>
<tr>
<th colspan="2">Item - Description</th>
</tr>
</thead>
</#if>
<tr>
<td colspan="2">${item.name}</td>
</tr>
</#list>
</#if>
</table>
But I am unable to render the units passed in.
<#if ITEMS?has_content>
<#if ITEMS.units?has_content> Units: ${ITEMS.units} </#if>
</#if>
Sorry this was rather long, but why can I not access the units variable?Eric Schultz
01/29/2021, 7:06 PM<#if item.units?has_content> Units: ${item.units} </#if>
nathanw
01/31/2021, 6:48 AMKatie V
02/10/2021, 7:42 PMRENDERER.addCustomDataSource({
alias: 'items',
format: render.DataSource.OBJECT,
data: items
});
nathanw
02/10/2021, 9:01 PMvar items = { 'items': [], 'units': units };
I use this var items = { 'units': units, 'items': [] };
With my limited understanding of js I don't think this would make any difference...Katie V
02/10/2021, 9:02 PM