jeudi 9 février 2023

How to handle the check/uncheck of two checkboxes used in the filter panel for a table?

I want to show the filtered data in a table based on the checked or unchecked checkbox present in the filter panel. The two checkbox are having two value such as 'Male' and 'Female'. I need to show the row data of 'Male' when 'Male' checkbox is checked and similar for 'Female'. When both unchecked it should show all the data.

I tried 'checked' prop of checkbox input field and I am toggling it based on the 'onChange' but when I am unchecking both checkboxes it is not behaving as expected and showing the data filtered insted it should show all the data when both checkboxes are unchecked.




Aucun commentaire:

Enregistrer un commentaire