我正在使用Jquery DataTable,并在我的Django应用程序中从PostgreSQL数据库获取数据。我可以将数据放入表中,但无法对表进行排序和搜索
datatables.js
:
// Call the dataTables jQuery plugin
$(document).ready(function() {
$('#dataTable').DataTable();
});
index.html
:
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Testing Type</th>
<th>Question</th>
<th>Difficulty Level</th>
</tr>
</thead>
{% for qiq in qa_interview_questions %}
<tbody>
<tr>
<td>{{ qiq.testingtype }}</td>
<td>{{ qiq.question }}</td>
<td>{{ qiq.difficultylevel }}</td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
</div>
不知何故,DataTable中的搜索和排序根本不起作用。如果我对数据进行硬处理,它就会起作用。 我做错了什么
目前没有回答
相关问题 更多 >
编程相关推荐