kendo外部模板绑定到网格

时间:2013-03-08 19:55:26

标签: kendo-ui

        <fieldset  id="trans">

            <legend>Transaction info

            </legend>
            <table>

                <tr class="PickListItem">
                    <td>Issued By:</td>
                    <td>#= ActionInitiatedBy #</</td>
                </tr>
                <tr>
                    <td>Exp Date Override:</td>
                    <td>#=ExpDateOverridden #</td>
                </tr>
                <tr>
                    <td>billing Status:</td>
                    <td></td>
                </tr>
                <tr>
                    <td>Bill Batch Date:</td>
                    <td></td>
                </tr>
                <tr>
                    <td>Refunded:</td>
                    <td> #=RefundedDate#</td>
                </tr>
                <tr>
                    <td>Refunded By:</td>
                    <td>#=RefundedBy#</td>
                </tr>
                <tr>
                    <td>
                        <div>
                            Note:
                        <br />
                            #= Note#

                        </div>



                    </td>

                </tr>
                <tr>
                    <td>

                            #if ("#= Refunded #" == 'no'   )
                            {#
                            <div>
                                    <label>Refund Amount : $ #= PatronChargeAmount #</label>    &nbsp;   <a onclick="Refund(' #= ActionHistory_id # ')" class="k-button">Refund?</a>

                            </div>

                            #}#


                    </td>

                </tr>
            </table>

        </fieldset>

我是MVC&amp;的新手剑道控制。 条件语句没有错误,但div从不显示。我究竟做错了什么。请帮忙。

2 个答案:

答案 0 :(得分:0)

您的HTML不正确!您写道:<td>#= ActionInitiatedBy #</</td>(还有一个</)。它应该是<td>#= ActionInitiatedBy #</td>

答案 1 :(得分:0)

确实你的情况不正确 - check the documentation

它应该是这样的

<td>
            #if (Refunded == 'no'){#
                        <div>
                           <label>Refund Amount : $ #= PatronChargeAmount #</label>    &nbsp;   <a onclick="Refund(' #= ActionHistory_id # ')" class="k-button">Refund?</a>
                        </div>
            #}#
</td>