我使用mui - datattables (gregnb),并希望在过滤器选项卡中自定义一个多选择下拉菜单,通过向下拉菜单中添加额外的列。
可能吗?它会在filteroptions。display中吗?或customFilterListOptions(我用它来定制芯片中的文本),如果是,请如何。
我得到它:指定filterType = 'custom'并返回Material-ui标记。例如
filterType = 'custom';
filterOptions = {
names: getMyArray(),
logic: (value, filters) => { ......
},
display: (filterList, onChange, index, column) => {
return (
<FormControl>
<InputLabel htmlFor="select-multiple-chip">Location</InputLabel>
<Select
className ={class1.A}
multiple
value={filterList[index]}
renderValue={(selected) => selected.join(", ")}
onChange={(event) => {
filterList[index] = event.target.value;
onChange(filterList[index], index, column);
}}
>
{locArr.map((name, name2) =>(
<MenuItem key={id} value={name} className ={classesF.A}>
<Checkbox className ={classesF.D} />
<ListItemText primary={name}/>
<ListItemText primary={name2}/>
</MenuItem>
))}
</Select>
</FormControl>
);
}