<% //# which types belong together in 1 tbody, the tbody wont close after 1 tr, until it doesnt match one of the types below! var isJoinType = function(type) { return (type == 'subclass' || type == 'leveldetail' || type == 'subclassgroup' || type == 'subclassdetail') } %> <% if(!isJoinType(field.getType())) { if(isJoinType(oldType)) { %> <% } //# print if(field.getType() == 'level%'){ %> <% }else{ %> <% } %> <% } else if(!isJoinType(oldType)) { %> <% } //# PRINT START ROW %> data-coa-id="<%= field.getId() %>"<% } %> class="<% if(field.getType() == 'level%'){ print("comparesales") } else if(field.getType() == 'leveldetail' || field.getType() == 'subclassdetail' || field.getType() == 'subclassgroup'){ print(field.getType()) } %>"><%= field.getName() %> <% //# ADD SUBTABLE _.each(datatable.getSubtables(), function(subtable, subtableIndex){ //# ADD COLUMNS _.each(subtable.getColumns(), function(column, i){ var colField = column.getFields()[index]; var isColDiff = column.getType() == 'compare'; //# IF we have a compare column & different from empty, force set class to perc (used for perc % sales) var colFormat = isColDiff && colField.getFormat() != 'empty' ? 'perc' : colField.getFormat(); %> style="width: 50px;<% if (colField.color != '') { %> background: <%= colField.color %>; <% } %><%= colField.getStyle() %>"><%= Ffof.App.Formatters.formatField(colField, isColDiff) %> <% }); }); %> <% if(!isJoinType(field.getType())) { %> <% } %>