2

如您所见,我有 3 个列表Procedur_HeadersDiagnosesList_Procedur. Procedur_headers给出了我的表格的标题, Diagnoses给出了一个过程的特定 id,并且 List_Procedur是一个列表(查询)的列表,其中包含了我需要的所有数据。现在我想做的是在

tal:repeat="list_procedur List_Procedur[index]"

我可以在我的表中获取我的数据。我已经可以得到索引:

tal:content="python:repeat['diagnoses'].index"

但我不能在索引的地方这样做。有没有人有这样的解决方案?

<table id="tableIngrepen" class="table">
    <thead class="header">
    <tr>
        <th>Code Diagnose vast</th>
        <th tal:repeat="procedur_headers Procedur_Headers" tal:content="procedur_headers" > </th>
    </tr>
    </thead>
    <tr tal:repeat="diagnoses Diagnoses"> 
        <td tal:content="python:repeat['diagnoses'].index"></td>
        <td ><input type='text' id="dz_code" class="input-mini" value="${diagnoses.code_diagnose}" onchange="voegrijtoe_Ingrepen(this.value,this);logging(this,'Code','2')" placeholder="Code"></input></td> <!-- onfocus="rijencolom($(this).parent().children().index($(this)),$(this).parent().parent().children().index($(this).parent()))" -->
        <td colspan="6">
            <table  id="tableIngrepen" class="table table-hover" style="border-style:none">
                <thead class="header">
                    <tr>
                        <th tal:repeat="procedur_headers Procedur_Headers" tal:content="procedur_headers" > </th> <!-- style="display:none"-->
                    </tr>
                </thead>
                <tr tal:repeat="list_procedur List_Procedur[index]">
                    <td style="max-width: 60px; word-wrap: break-word" >Uitleg over de Code van deze diagnose in maximaal 200 karakters</td>
                    <td ><input type='text' id="dz_Datum" class="input-small2" value="${list_procedur.code_diagnose}"  onchange="logging(this,'Datum','2');datumvalidate(this)" placeholder="yyyy-mm-dd"></input></td>
                    <td><input type='text' id="dz_dir" class="input-mini1"  onchange="logging(this,'Dir','2')" ></input></td>
                    <td><input type='text' id="dz_aan" class="input-mini1"  onchange="logging(this,'Aan','2')" ></input></td>
                    <td><input type='text' id="dz_uit" class="input-mini1"  onchange="logging(this,'Dz','2')" ></input></td>
                </tr>
                <tr>
                    <td style="max-width: 60px; word-wrap: break-word" >Uitleg over de Code van deze diagnose in maximaal 200 karakters</td>
                    <td ><input type='text' id="dz_Datum" class="input-small2"  onchange="logging(this,'Datum','2');datumvalidate(this)" placeholder="yyyy-mm-dd"></input></td>
                    <td><input type='text' id="dz_dir" class="input-mini1"  onchange="logging(this,'Dir','2')" ></input></td>
                    <td><input type='text' id="dz_aan" class="input-mini1"  onchange="logging(this,'Aan','2')" ></input></td>
                    <td><input type='text' id="dz_uit" class="input-mini1"  onchange="logging(this,'Dz','2')" ></input></td>
                </tr>
            </table>
        </td>
    </tr>
</table>
4

1 回答 1

3

解决方案是:

<tr tal:repeat="diagnoses Diagnoses"> <div tal:omit-tag="" tal:define="myindex python:repeat['diagnoses'].index"> ..use the myindex.. </div> </tr> 
于 2013-05-09T11:18:14.727 回答