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 112: Line 112:
     function updateFilter() {
     function updateFilter() {
         if (!table) return;
         if (!table) return;
       
 
         const selectedSources = Array.from(
         const selectedSources = Array.from(
             document.querySelectorAll('#data-source-filter input[type="checkbox"]:checked')
             document.querySelectorAll('#data-source-filter input[type="checkbox"]:checked')
Line 178: Line 178:


     function selectAll() {
     function selectAll() {
        // This won't trigger the 'change' event
         document.querySelectorAll('#data-source-filter input[type="checkbox"]').forEach(el => el.checked = true);
         document.querySelectorAll('#data-source-filter input[type="checkbox"]').forEach(el => el.checked = true);
        // Setting 'checked' attribute doesn't trigger 'change' event.
        updateFilter();
     }
     }
   
     function deselectAll() {
     function deselectAll() {
        // This won't trigger the 'change' event
         document.querySelectorAll('#data-source-filter input[type="checkbox"]').forEach(el => el.checked = false);
         document.querySelectorAll('#data-source-filter input[type="checkbox"]').forEach(el => el.checked = false);
        // Setting 'checked' attribute doesn't trigger 'change' event.
        updateFilter();
     }
     }
     </script>
     </script>

Revision as of 15:13, 8 June 2022

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