This commit is contained in:
KONE SOREL 2026-03-02 11:52:30 +00:00
parent ea3014baa1
commit 6ce39b8179

View File

@ -192,14 +192,22 @@
</div>
<script>
// SCRIPT DE RECHERCHE RAPIDE (Filtrage dynamique)
$(document).ready(function(){
$("#globalSearch").on("keyup", function() {
var value = $(this).val().toLowerCase();
$(".searchable-row").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
// RECHERCHE RAPIDE EN JAVASCRIPT PUR (SANS JQUERY)
document.addEventListener("DOMContentLoaded", function() {
const searchInput = document.getElementById('globalSearch');
if (searchInput) {
searchInput.addEventListener('keyup', function() {
const filter = this.value.toLowerCase();
const rows = document.querySelectorAll('.searchable-row');
rows.forEach(row => {
const text = row.textContent.toLowerCase();
// Si le texte correspond, on affiche la ligne, sinon on la cache
row.style.display = text.includes(filter) ? "" : "none";
});
});
});
}
});
</script>