模板条件逻辑不起作用

时间:2012-02-10 09:32:50

标签: jquery-templates

这是使用条件逻辑复选框的一些问题 我尝试检查=真或假,但它不工作,我在模板中选择条件逻辑,我想检查=“检查”匹配条件

    <table border="1">
  <thead>
    <tr>
      <th>Department Name</th>
      <th>Test Name</th>
      <th>Sub Test Name</th>
    </tr>
  </thead>
  <tbody>
    {#foreach $T.d as post}
    <tr>
      <td>{$T.post.Dep_Name}</td>
      <td>{$T.post.Test_Name}</td>
      <td>{$T.post.Sub_Test_Name}</td>

      <td>
      {{if $T.post.Status==Checked}}
      <input id="chkResult" type="checkbox" checked="checked" />
        {{/if}}
        <input id="chkResult" type="checkbox" />
      </td>
      <td><input id="Button2" type="button" value="button" /></td>

    </tr>
    {#/for}
  </tbody>
</table>

2 个答案:

答案 0 :(得分:0)

尝试使用与此相似的内容

 <input id="chkBox" type="checkbox" 
       {{if account.checkImage}} checked="checked"{{/if}} />

您需要修改{{if}}中的逻辑,如

 {{if $T.post.Status== "Checked" }} 

猜猜你要检查的条件是一个字符串。 如果您仍然面临任何问题,请告诉我。

答案 1 :(得分:0)

我让它像这样工作

<input type="checkbox" id="chk${FeeSettingDetailID}" {{if IsRefundable}} checked{{/if}} />
相关问题