mui-datatables icon indicating copy to clipboard operation
mui-datatables copied to clipboard

can we have a filterType = radio ?

Open leiyang opened this issue 3 years ago • 1 comments

we have filtertype = checkbox, and dropdown , dropdown is for single filter, can we make it as radio ?

thanks

leiyang avatar Aug 21 '22 12:08 leiyang

(filtertype = radio) I tried this but it is not working for me. so i have created a custom component and pass it MUIDatatable component property.

This is how i fix the issue.

import { FontAwesomeIcon, FontAwesomeIconProps } from '@fortawesome/react-fontawesome';

const StyledFontAwesomeIcon = styled(FontAwesomeIcon)color: ${({ theme }) => theme.palette.accent.lavenblue}; margin-left: 8px;; const CheckCircleIcon = () => <StyledFontAwesomeIcon icon={faCheckCircle as FontAwesomeIconProps['icon']} />; const CustomCheckbox = ({ checked }) => (checked ? <CheckCircleIcon /> : <></>);

<MUIDataTable data={data} columns={columns} options={{ options}} components={{ Checkbox: CustomCheckbox }} />

anishkumar23-01 avatar Jan 06 '23 05:01 anishkumar23-01