mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 修复crud2自定义显示列不生效问题
This commit is contained in:
parent
8039d312dc
commit
2d39ba9147
@ -1097,13 +1097,14 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
|
||||
}
|
||||
|
||||
@autobind
|
||||
toggleToggle(toggled: boolean, index: number) {
|
||||
toggleToggle(index: number) {
|
||||
const {store} = this.props;
|
||||
|
||||
const column = store.columns[index];
|
||||
const toggled = column.toggled;
|
||||
store.updateColumns(
|
||||
store.columns.map((c: any, i: number) => ({
|
||||
...c,
|
||||
toggled: index === i ? toggled : c.toggled !== false
|
||||
toggled: index === i ? !toggled : c.toggled !== false
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
@ -81,7 +81,8 @@ export class ColumnTogglerRenderer extends React.Component<ColumnTogglerRenderer
|
||||
className={cx('ColumnToggler-menuItem')}
|
||||
key={'selectAll'}
|
||||
onClick={() => {
|
||||
toggleAllColumns && toggleAllColumns();
|
||||
toggleAllColumns &&
|
||||
toggleAllColumns(activeToggaleColumns?.length <= 0);
|
||||
}}
|
||||
>
|
||||
<Checkbox
|
||||
|
Loading…
Reference in New Issue
Block a user