V
V
voronin_denis2016-11-28 15:37:17
JavaScript
voronin_denis, 2016-11-28 15:37:17

Marionette.js how to add a region to a table as a separate line?

There is a tpl item with the content:

<td> <div class ="tmcItem"><%= USER_NAME %></div></td>
<td ><div class ="tmcItem"><%= TMC_TYPE_NAME %></div></td>
<td ><div class ="tmcItem"><%= DISMISS_COUNT %></div><div id="content"></div></td>
<td ><div class ="tmcItem"><%= CULTURE_NAME %></div></td>
<td ><div class ="tmcItem"><%= DATE %></div></td>
<td><%= XLS_LOAD%></td>
<td><%= XLS_PRINT%></td>


It has a nested region "#content"

This region is added to the column. You need to add it on a separate line. How to do it using CompositeView?

tpl tables, headers defined, items added to body by default for CompositeView:

table class="table">
    <thead>
        <tr>
          <th >
            <div class="tmcLabel">ПОЛЬЗОВАТЕЛЬ</div>
          </th>
          <th >
            <div class="tmcLabel">ТИП ТМЦ</div>
          </th>
          <th >
            <div class="tmcLabel">КОЛИЧЕСТВО НАИМЕНОВАНИЙ</div>
          </th>
          <th >
            <div class="tmcLabel">КУЛЬТУРА</div>
          </th>
          <th>
            <div class="tmcLabel">ДАТА СПИСАНИЯ</div>
          </th>
          <th>
            <div class="tmcLabel">СОЗДАТЬ ДОКУМЕНТ</div>
          </th>
          <th>
            <div class="tmcLabel">ПЕЧАТЬ ДОКУМЕНТА</div>
          </th>
        </tr>
       
    </thead>
    <tbody>
    </tbody>
</table>


Items are collected here:
var ConfirmView = Marionette.CompositeView.extend({
        childView: ItemView,
        childViewContainer: "tbody",
        className: 'historyItem',
        emptyView: EmptyView,
        template: TemplateTable,
        
    });

// Сами итемы
 var ItemView = Marionette.LayoutView.extend({
        tagName: 'tr',
        template: ItemTemplate,
        regions: {
            footer: "#content"
        },
        
     ...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question