Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

140
Vistas
how do I filter a table's data from a dropdown menu-items with react and antd

I have been trying to at least filter a table based on some string of labels or dropdown menu items (one of them is super admin): I have tried using useEffect It filters now if i click on the super admin label. but the userRoleclicked array doesn't update when other labels are selected or deselected. instead it overwrites the array. Also in the UI, you can't click multiple items from the dropdown menu items expect one. I'm stuck and i don't know what to do

the code:

const [searchClinicianRoles, setSearchClinicianRoles] = useState<string[]>([]);

useEffect(() => {
        if (searchClinicianRoles.includes("Super admin")) {
            
            const filteredAclsByDropdown = allAcls.filter((a) => a.acl?.super_admin);
            setFilteredAcls(filteredAclsByDropdown);
        }
    }, [searchClinicianRoles, allAcls]);


------------------------------------------------------------------------------------
//for the filter button
  
  onSelectedItemsChange={(selectedItems) => {
                    
                    const userRolesClicked = selectedItems.map(
                        (selectedItem) => selectedItem.label
                    );

                    
                    setSearchClinicianRoles(userRolesClicked);
                    
                }}

this is what i am trying to achieve:

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda