Hello!
I am currently trying to develop a plugin, which disables some columns in Table-v2 component. Is there any way, using useDesignable on table schema, to manipulate visibility of columns? I tried doing:
export const tableShowIndexSettingsItem: SchemaSettingsItemType = {
name: 'showIndex',
type: 'switch',
useComponentProps() {
const fieldSchema = useFieldSchema();
const dn = useDesignable();
return {
title: 'Show Index',
checked: !!fieldSchema['x-decorator-props'].showIndex,
onChange(v: boolean) {
console.log('fieldSchema', fieldSchema);
dn.deepMerge({
'x-uid': fieldSchema['x-uid'],
'x-decorator-props': {
...fieldSchema['x-decorator-props'],
showIndex: v,
},
'x-component-props': {
...fieldSchema['x-component-props'],
rowSelection: v && fieldSchema['x-component-props'] ? fieldSchema['x-component-props'].rowSelection : undefined,
},
});
},
};
},
};
But setting them undefined in row selection didnt really work. And it would be really cool if i could get a list of names of columns, and then remove ones based on names.
Btw, this is modified example from sample plugins. Also i was thinking about changing behavior of original antd component, is there a way to not create another component and modify existing props?