Topic: MDBdatatables : clear the selected
cariforef priority asked 2 months ago
I would like to create a cart and fill it with the selected row. Then I want to unselected everything after adding to cart. How can I manage this ? thanks.
You can create a state with the selected row data, use the
onSelectRow event to get the row user desires and display it in the cart.
There are no options in the component to uncheck everything in the table, so there are 2 options:
- You can store the data for the table in the state and after adding them to the cart you can set the state again to defaults. That should rerender the component and uncheck everything.
- After adding items to the cart you can use the
querySelectorAllfunction to get all checked elements and manually trigger the
clickevent on them.
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Priority
- Premium support: Yes
- Technology: MDB React
- MDB Version: MDB5 5.0.0
- Device: MAC
- Browser: Chrome
- OS: Mac OSX 15
- Provided sample code: No
- Provided link: No