Question

As you can see I have 3 lists: Procedur_Headers, Diagnoses and List_Procedur. Procedur_headers gives the headers of my tabels, Diagnoses gives the specific id of a procedure and List_Procedur is a list of lists (query’s) where all the data that I need is contained. Now what I want to do is to have the index of the Diagnoses page in the

tal:repeat="list_procedur List_Procedur[index]"

that I can get my data in my table. I already can get the index:

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

but I can't do this at the place of index. Does anybody have a solution for something like this?

<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>
Was it helpful?

Solution

The solution is:

<tr tal:repeat="diagnoses Diagnoses"> <div tal:omit-tag="" tal:define="myindex python:repeat['diagnoses'].index"> ..use the myindex.. </div> </tr> 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top