Widget: DCTList: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
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 14:07, 24 November 2022
Development verstion of the DCT List.
Not ready for production!