@voronin_denis

Marionette.js как добавить регион к таблице отдельной строкой?

Есть tpl итема с содержимым:

<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>


В него вложен регион "#content"

Этот регион добавляется к колонке. Нужно его добавлять отдельной строкой. Как это сделать используя CompositeView?

tpl таблицы, определены заголовки, итемы добавляются в тело по умолчанию для 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>


Итемы собираются тут :
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"
        },
        
     ...
  • Вопрос задан
  • 197 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы