Difference between revisions of "Widget:DCTList"
From LINKS Community Center
Line 394: | Line 394: | ||
// If filtering property is empty, don't apply the filter (set the check to true). | // If filtering property is empty, don't apply the filter (set the check to true). | ||
// Passing an empty object (as with applyFilters(true)) should result in an unfiltered table. | // Passing an empty object (as with applyFilters(true)) should result in an unfiltered table. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
let functionsCheck = true; | let functionsCheck = true; | ||
Line 773: | Line 768: | ||
// Set up the table if parameter was passed. | // Set up the table if parameter was passed. | ||
const params = new URLSearchParams(window.location.search); | const params = new URLSearchParams(window.location.search); | ||
− | const | + | const encoded = params.get('do'); |
− | + | ||
− | if ( | + | if (encoded) { |
− | const | + | const action = JSON.parse(decodeURIComponent(atob(encoded))); |
− | + | if (action.filter) { | |
+ | Object.keys(action.filter).forEach(fnCat => { | ||
+ | const fnBlock = document.getElementById('func-filter-' + escapeAttr(fnCat)).closest('.func-filter-block'); | ||
+ | fnBlock.querySelectorAll('input[type="checkbox"]').forEach(box => box.checked = actions.filter[fnCat]); | ||
+ | }); | ||
+ | } | ||
} | } | ||
}); | }); |
Revision as of 15:07, 24 November 2022
Development verstion of the DCT List.
Not ready for production!