Difference between revisions of "Widget:DCTList"
From LINKS Community Center
Line 414: | Line 414: | ||
// 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. | ||
+ | |||
+ | console.log('FILT', filterState) | ||
let functionsCheck = true; // automatically pass functions check if the filter missing | let functionsCheck = true; // automatically pass functions check if the filter missing | ||
Line 461: | Line 463: | ||
const filterState = {}; | const filterState = {}; | ||
− | if ( | + | if (document.querySelectorAll('#functions-filter input[type="checkbox"]:checked').length > 0) { |
− | |||
− | |||
− | |||
const functionFilterBlocks = document.querySelectorAll('#functions-filter .func-filter-block'); | const functionFilterBlocks = document.querySelectorAll('#functions-filter .func-filter-block'); | ||
const funcOpts = new Map(); | const funcOpts = new Map(); | ||
Line 484: | Line 483: | ||
if (selectedSources.length > 0) filterState.dataSources = selectedSources; | if (selectedSources.length > 0) filterState.dataSources = selectedSources; | ||
− | const | + | const selectedBModels = Array.from(document.querySelectorAll('#business-model-filter input[type="checkbox"]:checked')) |
− | + | .map(checkbox => checkbox.value); | |
− | filterState.businessModel = | + | if (selectedBModels.length > 0) filterState.businessModel = selectedBModels; |
− | + | if (document.getElementById('used-by-practitioners').checked) filterState.usedByDmo = 'yes'; | |
− | + | if (document.getElementById('has-use-case').checked) filterState.hasUC = 'yes'; | |
table.setFilter(dctFilter, filterState); | table.setFilter(dctFilter, filterState); |
Revision as of 15:19, 9 March 2023
Current version of the DCT List.
Not ready for production!