mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +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
|
@autobind
|
||||||
toggleToggle(toggled: boolean, index: number) {
|
toggleToggle(index: number) {
|
||||||
const {store} = this.props;
|
const {store} = this.props;
|
||||||
|
const column = store.columns[index];
|
||||||
|
const toggled = column.toggled;
|
||||||
store.updateColumns(
|
store.updateColumns(
|
||||||
store.columns.map((c: any, i: number) => ({
|
store.columns.map((c: any, i: number) => ({
|
||||||
...c,
|
...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')}
|
className={cx('ColumnToggler-menuItem')}
|
||||||
key={'selectAll'}
|
key={'selectAll'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
toggleAllColumns && toggleAllColumns();
|
toggleAllColumns &&
|
||||||
|
toggleAllColumns(activeToggaleColumns?.length <= 0);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
Loading…
Reference in New Issue
Block a user