为什么我有 JS 错误 "i is undefined jquery.datatables.min.js"
Why do I have a JS error "i is undefined jquery.datatables.min.js"
这是我的 HTML/twig:
<table
class="table table-striped"
data-toggle="datatable"
data-number-rows-display=5
>
<thead>
<tr>
<th data-exportable="true" data-sortable="true">Nom</th>
<th data-exportable="true" data-sortable="true">Prénom</th>
<th data-exportable="true">Téléphone fixe</th>
<th data-exportable="true">Téléphone portable</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{% for individual in people %}
<tr>
<td class="align-middle">{{ individual.lastname }}</td>
<td class="align-middle">{{ individual.firstname }}</td>
<td class="align-middle"><div class="phone">{{ individual.homePhoneNumber }}</div></td>
<td class="align-middle"><div class="phone">{{ individual.cellPhoneNumber }}</div></td>
<td class="align-middle column-action">
<a
href="{{ path('people_edit', { 'id': individual.id }) }}"
class="btn btn-secondary"
data-toggle="modal"
data-target="#information-people-{{ individual.id }}"
>
<i class="icon ion-md-repeat"></i> Relancer
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
我使用 data-toggle="datatable"
切换数组上的 DataTable。
我的 javascript 控制台向我发出警告 i is undefined jquery.datatables.min.js
。不明白是什么意思,怎么解决。
将我生成的 HTML 通过 W3C validator 后,我发现我的 <th>
比 <td>
多(6 <th>
5 <td>
)。删除其中一个 <th>
解决了问题。
这是我的 HTML/twig:
<table
class="table table-striped"
data-toggle="datatable"
data-number-rows-display=5
>
<thead>
<tr>
<th data-exportable="true" data-sortable="true">Nom</th>
<th data-exportable="true" data-sortable="true">Prénom</th>
<th data-exportable="true">Téléphone fixe</th>
<th data-exportable="true">Téléphone portable</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{% for individual in people %}
<tr>
<td class="align-middle">{{ individual.lastname }}</td>
<td class="align-middle">{{ individual.firstname }}</td>
<td class="align-middle"><div class="phone">{{ individual.homePhoneNumber }}</div></td>
<td class="align-middle"><div class="phone">{{ individual.cellPhoneNumber }}</div></td>
<td class="align-middle column-action">
<a
href="{{ path('people_edit', { 'id': individual.id }) }}"
class="btn btn-secondary"
data-toggle="modal"
data-target="#information-people-{{ individual.id }}"
>
<i class="icon ion-md-repeat"></i> Relancer
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
我使用 data-toggle="datatable"
切换数组上的 DataTable。
我的 javascript 控制台向我发出警告 i is undefined jquery.datatables.min.js
。不明白是什么意思,怎么解决。
将我生成的 HTML 通过 W3C validator 后,我发现我的 <th>
比 <td>
多(6 <th>
5 <td>
)。删除其中一个 <th>
解决了问题。