2

ご覧のとおりProcedur_HeadersDiagnosesとの 3 つのリストがありList_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 に答える