Widget: DCTList: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 131: Line 131:
         const selectedSources = Array.from(document.querySelectorAll('#data-source-filter input[type="checkbox"]:checked')).map(checkbox => checkbox.value);
         const selectedSources = Array.from(document.querySelectorAll('#data-source-filter input[type="checkbox"]:checked')).map(checkbox => checkbox.value);
         filterState.dataSources = selectedSources;
         filterState.dataSources = selectedSources;
        document.querySelectorAll('.data-source-cell .data-source-img').forEach(img => {
            if (selectedSources.includes(img.dataset.value)) { img.classList.remove('unselected') }
            else { img.classList.add('unselected'); }
        });


         table.setFilter(dctFilter, filterState);
         table.setFilter(dctFilter, filterState);
Line 189: Line 184:
         tabulator.on('dataFiltered', (filters, rows) => {
         tabulator.on('dataFiltered', (filters, rows) => {
             console.log(filters)
             console.log(filters)
            selectedSources = filters[0].type.dataSources;
            document.querySelectorAll('.data-source-cell .data-source-img').forEach(img => {
            if (selectedSources.includes(img.dataset.value)) { img.classList.remove('unselected') }
            else { img.classList.add('unselected'); }
        });
         });
         });



Revision as of 16:24, 8 June 2022

Development verstion of the DCT List.
Not ready for production!