如你所见,我有3个列表:Procedur_Headers,Diagnoses和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>发布于 2013-05-09 19:18:15
解决方案是:
<tr tal:repeat="diagnoses Diagnoses"> <div tal:omit-tag="" tal:define="myindex python:repeat['diagnoses'].index"> ..use the myindex.. </div> </tr> https://stackoverflow.com/questions/16400842
复制相似问题