【发布时间】:2014-01-02 10:24:44
【问题描述】:
我有一个表,它的标题是使用 foreach 和数据绑定动态填充的。我在标签内也提到了一个静态元素“hello”,但在页面加载时,Hello 被数据绑定文本替换。为什么不将 hello 和 data-bind 文本一起显示。
demo.html : html table having foreach binding and static content
====================================================================
<table cellspacing="0" style="width: 100%;">
<thead>
<tr class="headerRow" data-bind="foreach:tableHeader">
<th class="headerElement " w="3" style="width: 12%;" data-bind="text:$data.header">Hello</th>
</tr>
</thead>
</table>
在为表头列之一做 Inspect Element 时,代码如下:
患者姓名
请告诉我为什么 hello 被替换为每个数据
【问题讨论】: