Skip to content

Commit 39c4140

Browse files
authored
Merge pull request #321 from dbarzin/dev
Dev
2 parents 901189e + c415c0f commit 39c4140

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

resources/views/controls/index.blade.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
</div>
9696
</div>
9797

98-
<table class="table striped row-hover cell-border"
98+
<table class="table data-table striped row-hover cell-border"
9999
data-role="table"
100100
data-rows="100"
101101
data-show-activity="true"
@@ -194,12 +194,20 @@
194194
</div>
195195
</div>
196196
<script>
197-
window.addEventListener('load', function(){
197+
document.addEventListener("DOMContentLoaded", function () {
198198
// Récupère le paramètre search
199199
let params = new URLSearchParams(window.location.search);
200-
if (params.has('search')) {
200+
const searchValue = params.get('search');
201+
if (searchValue) {
202+
// get serach filter
201203
let searchInput = document.querySelector('.table-search-block input');
202-
searchInput.value = params.get('search');
204+
searchInput.value = searchValue;
205+
// Trouve la table et applique la recherche
206+
let tableElement = document.querySelector('.data-table');
207+
let table = Metro.getPlugin(tableElement, "table");
208+
if (table)
209+
table.search(searchValue);
210+
203211
}
204212
// Auto submits
205213
var select = document.getElementById('domain');

0 commit comments

Comments
 (0)