Changed Client-side Search to Server-side Search
This commit is contained in:
@ -15,7 +15,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
if (isDashboard) {
|
||||
// Dashboard-specific initialization
|
||||
initSearch();
|
||||
initStatusFilter();
|
||||
initTableSorting();
|
||||
|
||||
@ -192,22 +191,6 @@ function initThemeToggle() {
|
||||
document.body.appendChild(toggle);
|
||||
}
|
||||
|
||||
function initSearch() {
|
||||
const searchBox = document.createElement('input');
|
||||
searchBox.type = 'text';
|
||||
searchBox.placeholder = 'Search tickets...';
|
||||
searchBox.className = 'search-box';
|
||||
searchBox.oninput = (e) => {
|
||||
const searchTerm = e.target.value.toLowerCase();
|
||||
const rows = document.querySelectorAll('tbody tr');
|
||||
rows.forEach(row => {
|
||||
const text = row.textContent.toLowerCase();
|
||||
row.style.display = text.includes(searchTerm) ? '' : 'none';
|
||||
});
|
||||
};
|
||||
document.querySelector('h1').after(searchBox);
|
||||
}
|
||||
|
||||
function initStatusFilter() {
|
||||
const filterContainer = document.createElement('div');
|
||||
filterContainer.className = 'status-filter-container';
|
||||
|
||||
Reference in New Issue
Block a user