【发布时间】:2013-06-12 12:29:51
【问题描述】:
我有一个表格,其中包含来自集合的数据。当用户单击一行时,我想用表单替换该行的内容以编辑内容。如果可能的话,如果没有 jQuery,流星的方式会是什么?
<template name="table">
<table>
{{#each items}}
{{> showrow}}
{{else}}
</table>
</template>
<template name="showrow">
<tr>
<td>{{name}}</td>
</tr>
</template>
<template name="editrow">
<tr>
<form>
… form html …
</form>
</tr>
</template>
我认为,基本上,这是关于用editrow 替换showrowtemplate for onw 行。这是一个合理的方法吗?有什么指点吗?
【问题讨论】:
-
好的,我想我可以使用模板系统更改 HTML,答案是:stackoverflow.com/a/15092343/233430。但是我如何只为特定的表格行做到这一点?
标签: meteor