【发布时间】:2013-12-11 14:36:48
【问题描述】:
我有点问题。我的表格数据是这样的,你有一个表格,分成列组,然后分成列。为了争论,让我们这样说:
<person>
<details>
<age>26</age>
<birthplace>Amsterdam</birthplace>
</details>
<appearance>
<hair>Brown</hair>
<eyes>Grey</eyes>
</appearance>
<clothes>
<trousers>Black</trousers>
<shirt>Red</shirt>
</clothes>
</person>
据此,我的想法是这些群体可以/应该这样表示:
+-------------------------------------------------------+
| Layout |
| +---------------+ +---------------+ +---------------+ |
| | Composite | | Composite | | Composite | |
| | +----+ +----+ | | +----+ +----+ | | +----+ +----+ | |
| | |Item| |Item| | | |Item| |Item| | | |Item| |Item| | |
| | +----+ +----+ | | +----+ +----+ | | +----+ +----+ | |
| +---------------+ +---------------+ +---------------+ |
+-------------------------------------------------------+
因为表格组应该能够独立地隐藏在视图中,或者对它们执行其他操作(作为一个组)。
但是,这是表格数据,因此在语义上应该像这样显示(带有适当的 table 和 tbody 标签):
<table>
<colgroup>
<col>...</col>
...
</colgroup>
<thead>
<tr>
<th>Age</th>
...
</tr>
</thead>
<tbody>
<tr>
<td>26</td>
<td>Amsterdam</td>
<td>Brown</td>
<td>Grey</td>
<td>Black</td>
<td>Red</td>
</tr>
...
</tbody>
</table>
关于如何实现这一点的任何想法?我想(可能是错误的)我将不得不以某种方式扩展/破解 Marionette 以使其产生所需的输出 - 我只是不知道这可能会发生什么!或者实际上,如果我的大脑开始思考错误的东西...... :)
【问题讨论】:
-
你有一些代码要显示吗?
-
嗨 Juliano - 不,我没有任何代码,我只是想说明问题所在,并且想知道(基本上)如何制作 3 个分层视图(祖父母、父母、 child) 在 Marionette 中显示为 2 个 HTML 元素 ...
标签: html dom backbone.js marionette