Skip to content

Commit bd4d07b

Browse files
adding script to execute filtering based on typed text
1 parent 111366a commit bd4d07b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

sde_indexing_helper/static/js/collection_list.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,28 @@ $(document).ready(function () {
405405
"Connector Type",
406406
];
407407

408+
// Event listener for the collection search input
409+
$('#collectionSearch').on('keyup', function () {
410+
// Get the search query
411+
let query = $(this).val().toLowerCase();
412+
413+
// Clear previous search
414+
table.search('').columns().search('');
415+
416+
// Filter the table based on the query in the collection name and config folder data attribute
417+
table.rows().every(function () {
418+
let row = $(this.node());
419+
let name = row.find('td').first().text().toLowerCase();
420+
let configFolder = row.data('config-folder').toLowerCase();
421+
422+
if (name.includes(query) || configFolder.includes(query)) {
423+
row.show();
424+
} else {
425+
row.hide();
426+
}
427+
});
428+
});
429+
408430
$(".dtsp-searchPane").each(function (index) {
409431
if ($(this).hasClass("dtsp-hidden")) {
410432
return;

0 commit comments

Comments
 (0)