Make datatable work for each table on the page, not just the first
This commit is contained in:
parent
8f28a444a2
commit
8aa1148f7a
1 changed files with 6 additions and 6 deletions
|
@ -49,12 +49,12 @@
|
|||
<script src="{{ STATIC_URL }}datatables/js/dataTables.bootstrap.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("table.table-reportdata").dataTable({
|
||||
"sDom": "<'row'<'col-md-3'l><'col-md-3'T><'col-md-4'f>r>t<'row'<'col-md-3'i><'col-md-5'p>>",
|
||||
$("table.table-reportdata").each(function () {
|
||||
$(this).dataTable({
|
||||
"sDom": "<'row'<'col-md-3'l><'col-md-3'T><'col-md-4'f>r>t<'row'<'col-md-3'i><'col-md-5'p>>",
|
||||
"sPaginationType": "bootstrap",
|
||||
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
|
||||
"bStateSave": true,
|
||||
"aLengthMenu": [[10, 50, 100, -1], [10, 50, 100, "All"]],
|
||||
"oTableTools": {
|
||||
"aButtons": [
|
||||
"copy",
|
||||
|
@ -63,7 +63,7 @@
|
|||
],
|
||||
"sSwfPath": "{{ STATIC_URL }}tabletools/swf/copy_csv_xls.swf"
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue