tags filter.
This commit is contained in:
@@ -220,4 +220,18 @@ function sortTable(tabName, columnName, desc) {
|
||||
}
|
||||
});
|
||||
$(`#${tabName} table tbody`).html(sortedRow);
|
||||
}
|
||||
function filterTable(tabName, sender) {
|
||||
var tagName = sender.textContent;
|
||||
var rowData = $(`#${tabName} table tbody tr`);
|
||||
rowData.map((index, elem) => {
|
||||
var dataTags = $(elem).attr('data-tags');
|
||||
console.log(dataTags);
|
||||
if (dataTags == undefined || !dataTags.split(",").includes(tagName)) {
|
||||
$(elem).hide();
|
||||
} else {
|
||||
console.log('show');
|
||||
$(elem).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user