2011-04-20 90 views
0

使用JQuery/JTemplates/ASP.NET可以使用这种嵌套的UI吗?在ASP.NET中使用嵌套J模板的JQuery

或多或少的伪代码:重要的部分是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> 

回答

0

嵌套 - 每个都应该是可能的:请参阅this article说明该示例。

只有我和你的代码中看到的问题是,我认为,线

{#foreach $T.table1 as doc} 

应该像

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

即你需要参考的嵌套表在父母的每条记录表。

+0

这看起来不错! – msfanboy 2011-04-20 07:22:16