<% locations = [@item.location] if @item.type == 'section' locations = @item.locations if @item.type == 'tabs' titles = [@item.title] if @item.type == 'section' titles = @item.titles if @item.type == 'tabs' %> <% for loc, locIdx in locations :%> <% context = @addForm( loc ) context.props.gh = context.gridHelper() %> <% if context.form : %> <% columnWidths = context.form.pdfColumnWidths( context.props.gh ) %> { layout: 'panel', table: { tableForm: true, location: '<%- loc %>', widths: ['*'], body: [ [{text: '<%- ( @mlText( titles[locIdx] ) || '' ).replace( '\'', '\\\'' ) %>', style: 'tableHeader'}], [{ table: { tableForm: true, widths: [ <% for w, col in columnWidths : %> {BEGIN col_<%- loc %>_<%- col %>} <%- JSON.stringify(w) %>, {END col_<%- loc %>_<%- col %>} <% end %> ], body: [ <% include 'pdf/gridbody.htm', context.addProp( "rowGroup", context.form.singleRowGroup() ) %> ] } }] ] }, margin: [0,0,0,15], }, <% end %> <% end %>