<% @props.helper = @form.helper() @props.formWidth = @props.helper.width() if @fullWidthForm() @props.fullWidthForm = true else @props.visualCells = @form.visualCellWidths() %> {BEGIN <%- @location %>_block} <% @props.openTable = () => %> class="r-edit-form" cellpadding="0" cellspacing="0" {$grid_hiddenattr} <% if !@form.separateLabels : %> data-form-width="<%- @props.formWidth %>" <% end %> <% if @props.visualCells : %> data-v-width="<%- @props.visualCells.gridWidth %>" <% end %> > <% end %> <% @props.openCell = (context) => %> <% context.props.fullWidthCell = false if context.props.fullWidthForm && ( context.props.formWidth == 1 || context.props.formWidth == context.gridCell.colspan ) context.props.fullWidthCell = true if @form.effective( 'useFullWidth', context.gridCell.cell ) context.props.fullWidthCell = false %> {BEGIN cellblock_<%- context.location %>_<%- context.gridCell.cell %>} {END cellblock_<%- @location %>_<%- @gridCell.cell %>} <% end %> <% end %> <% if @props.rowOpened : %> <% @props.rowOpened = false %> <% end %> <% end %> <% if @props.tableOpened : %> <% @props.tableOpened = false %>
_<%- context.gridCell.cell %>} class="<%- context.form.cellClasses( context.gridCell.cell ) %>" <% if context.cell.columnName == 'field' : %> data-field="<%- @goodFieldName( context.cell.field ) %>" <% end %> <% if context.cell.items.length <= 1 : %> data-single <% end %> <% if context.props.fullWidthCell : %> data-fullwidth <% end %> <%- if context.gridCell.colspan>1 then 'ocolspan="'+context.gridCell.colspan+'"' else '' %> <%- if context.gridCell.rowspan>1 then 'orowspan="'+context.gridCell.rowspan+'"' else '' %> <%- context.cellAttr( context.gridCell.cell ) %> <% if context.props.visualCells : %> data-v-cell="<%- context.props.visualCells.cellWidths[ context.gridCell.cell ] %>" <% end %> >
<% end %> <% @props.tableOpened = false; @props.rowOpened = false; @props.cellOpened = false; @props.breakTable = ( rowIdx, itemIdx = 0 ) => row = @form.grid[ rowIdx ] if row.cells.length != 1 or (row.cells[0].colspan || 1) != @props.formWidth return false cell = @form.cells[ row.cells[0].cell ] if cell.items.length <= itemIdx return false; return @page.items[ cell.items[itemIdx] ].breaksTable() %> <% for rowIdx in Object.keys( @form.grid ) : %> <% for gridCell, cellIdx in @form.grid[rowIdx].cells : %> <% include 'forms/edit-grid-cell.htm', @addCell( rowIdx, cellIdx, false ) %> <% if @props.cellOpened : %> <% @props.cellOpened = false %>
<% end %> {END <%- @location %>_block}