Use separate JavaScript file to initialize DataTables
This commit is contained in:
parent
b161b389b4
commit
38e562a3ac
4 changed files with 13 additions and 11 deletions
|
@ -1,5 +1,8 @@
|
||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 2.2.1 - 2019/11/10
|
||||||
|
* Use separate JavaScript file to initialize DataTables
|
||||||
|
|
||||||
## 2.2.0 - 2019/11/10
|
## 2.2.0 - 2019/11/10
|
||||||
* Add version tag to footer
|
* Add version tag to footer
|
||||||
* Add sortable tables
|
* Add sortable tables
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Constants
|
||||||
/**
|
/**
|
||||||
* Version tag
|
* Version tag
|
||||||
*/
|
*/
|
||||||
const VERSION = '2.2.1-SNAPSHOT';
|
const VERSION = '2.2.1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return constant by it's class name
|
* Return constant by it's class name
|
||||||
|
|
8
public/theme/bootstrap4/js/custom.js
Normal file
8
public/theme/bootstrap4/js/custom.js
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#table').DataTable({
|
||||||
|
"language": {
|
||||||
|
"url": "/theme/bootstrap4/DataTables/en_dataTable.json"
|
||||||
|
},
|
||||||
|
"paging": false
|
||||||
|
});
|
||||||
|
});
|
|
@ -68,18 +68,9 @@
|
||||||
<!-- Script -->
|
<!-- Script -->
|
||||||
<script src="/theme/bootstrap4/js/bootstrap.bundle.min.js"></script>
|
<script src="/theme/bootstrap4/js/bootstrap.bundle.min.js"></script>
|
||||||
<script src="/theme/bootstrap4/DataTables/datatables.min.js"></script>
|
<script src="/theme/bootstrap4/DataTables/datatables.min.js"></script>
|
||||||
|
<script src="/theme/bootstrap4/js/custom.js"></script>
|
||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
<script>
|
|
||||||
$(document).ready(function() {
|
|
||||||
$('#table').DataTable( {
|
|
||||||
"language": {
|
|
||||||
"url": "/theme/bootstrap4/DataTables/en_dataTable.json"
|
|
||||||
},
|
|
||||||
"paging": false
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
Reference in a new issue