【问题标题】:JQuery with nested JTemplates in ASP.NETJQuery 与 ASP.NET 中的嵌套 JTemplates
【发布时间】:2011-04-20 05:47:06
【问题描述】:

JQuery/JTemplates/ASP.NET 可以有这样一个嵌套的 UI 吗?

或多或少的伪代码:重要的部分是 td 内的第二个 foreach 循环。

 <table>
            <thead style="font-weight: bold">
                <tr>
                    <td>{$P.lang['pupilName']}</td>
                    <td>{$P.lang['mail']}</td>                        
                </tr>
            </thead>
            <tbody>
                {#foreach $T.table as record}
                <tr>
                        <td>{$T.record.name}</td>
                        <td>{$T.record.mail}</td>
                        <td> // thats the 3rd column containing a listbox/list with documents
                         {#foreach $T.table1 as doc}
                            <ul>
                                <li>excel sheet 1</li>
                                <li>word document 2</li>
                                <li>pdf document 4</li>
                            </ul>                       
                         {#/for}
                        </td>
                </tr>
                {#/for}
            </tbody>
        </table>

【问题讨论】:

    标签: jquery asp.net templates nested jtemplates


    【解决方案1】:

    嵌套 for-each 应该是可能的:请参阅说明示例的 this article

    我在您的代码中看到的唯一问题是我相信那一行

    {#foreach $T.table1 as doc}
    

    应该是这样的

    {#foreach $T.record.table1 as doc}
    

    即您需要为父表中的每条记录引用一个嵌套表。

    【讨论】:

      猜你喜欢
      • 2014-11-19
      • 2011-09-24
      • 1970-01-01
      • 2011-01-15
      • 2016-11-17
      • 1970-01-01
      • 1970-01-01
      • 2011-05-10
      • 2020-12-03
      相关资源
      最近更新 更多