Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!