mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-01 19:38:16 +08:00
Merge pull request #9575 from zhangtao07/master
fix: 修复crud2自定义显示列不生效问题
This commit is contained in:
commit
d6208f8d05
@ -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