Skip to content

Commit 783003f

Browse files
committed
fix datatable initialization issue
1 parent fc42693 commit 783003f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/resources/views/crud/inc/filters_navbar.blade.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function normalizeAmpersand(string) {
114114
115115
// behaviour for ajax table
116116
var new_url = '{{ url($crud->getOperationSetting("datatablesUrl").'/search') }}';
117-
var ajax_table = $("#crudTable").DataTable();
117+
var ajax_table = new DataTable('#crudTable');
118118
119119
// replace the datatables ajax url with new_url and reload it
120120
ajax_table.ajax.url(new_url).load();
@@ -124,6 +124,9 @@ function normalizeAmpersand(string) {
124124
125125
// remove filters from URL
126126
crud.updateUrl(new_url);
127+
128+
// hide the Remove filters button when no filter is active
129+
$('#remove_filters_button').addClass('invisible');
127130
});
128131
129132
// hide the Remove filters button when no filter is active
@@ -132,7 +135,6 @@ function normalizeAmpersand(string) {
132135
$(".navbar-filters li[filter-name]").each(function () {
133136
if ($(this).hasClass('active')) {
134137
anyActiveFilters = true;
135-
// console.log('ACTIVE FILTER');
136138
}
137139
});
138140

0 commit comments

Comments
 (0)