Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ› [BUG] DragSortTable --- Reorder columns by dragging and dropping columns will have issues when the table has fixed columns first #7631

Closed
tanjianyong opened this issue Sep 6, 2023 · 1 comment

Comments

@tanjianyong
Copy link
Contributor

tanjianyong commented Sep 6, 2023

πŸ› bug 描述

Reorder columns by dragging and dropping columns will have issues when the table has fixed columns first

πŸ“· 倍现ζ­₯ιͺ€ | Recurrence steps

image

If the table has first two fixed columns and I drag 2023-08-07 to the middle of 2023-08-08 and 2023-08-09, 2023-08-07 will be below the 2023-08-09.

If the table doesn't have the fixed columns, it can work as expected.

🏞 ζœŸζœ›η»“ζžœ | Expected results

The column 2023-08-07 can be between 2023-08-08 and 2023-08-09 after draging.

πŸ’» 倍现代码 | Recurrence code

const [newColumns, setNewColumns] = useState([{"title":"WS1_HB_NUM","dataIndex":"hardBinNum","key":"hardBinNum","rowScope":"row","width":20,"fixed":"left","isShowDeltaMenu":false},{"title":"WS1_HB_DESCP","dataIndex":"hardBinDescp","key":"WS1_HB_DESCP","rowScope":"row","width":20,"fixed":"left","isShowDeltaMenu":false},{"title":"2023-08-28","dataIndex":"yieldNum2023-08-28","key":"yieldNum2023-08-28","width":50},{"title":"2023-08-19","dataIndex":"yieldNum2023-08-19","key":"yieldNum2023-08-19","width":50},{"title":"2023-08-08","dataIndex":"yieldNum2023-08-08","key":"yieldNum2023-08-08","width":50},{"title":"2023-08-18","dataIndex":"yieldNum2023-08-18","key":"yieldNum2023-08-18","width":50},{"title":"2023-08-25","dataIndex":"yieldNum2023-08-25","key":"yieldNum2023-08-25","width":50},{"title":"2023-08-12","dataIndex":"yieldNum2023-08-12","key":"yieldNum2023-08-12","width":50},{"title":"2023-08-15","dataIndex":"yieldNum2023-08-15","key":"yieldNum2023-08-15","width":50},{"title":"2023-09-03","dataIndex":"yieldNum2023-09-03","key":"yieldNum2023-09-03","width":50},{"title":"2023-09-01","dataIndex":"yieldNum2023-09-01","key":"yieldNum2023-09-01","width":50},{"title":"2023-08-10","dataIndex":"yieldNum2023-08-10","key":"yieldNum2023-08-10","width":50},{"title":"2023-08-30","dataIndex":"yieldNum2023-08-30","key":"yieldNum2023-08-30","width":50},{"title":"2023-08-16","dataIndex":"yieldNum2023-08-16","key":"yieldNum2023-08-16","width":50},{"title":"2023-09-05","dataIndex":"yieldNum2023-09-05","key":"yieldNum2023-09-05","width":50},{"title":"2023-08-29","dataIndex":"yieldNum2023-08-29","key":"yieldNum2023-08-29","width":50},{"title":"2023-08-13","dataIndex":"yieldNum2023-08-13","key":"yieldNum2023-08-13","width":50},{"title":"2023-08-07","dataIndex":"yieldNum2023-08-07","key":"yieldNum2023-08-07","width":50},{"title":"2023-09-02","dataIndex":"yieldNum2023-09-02","key":"yieldNum2023-09-02","width":50},{"title":"2023-08-26","dataIndex":"yieldNum2023-08-26","key":"yieldNum2023-08-26","width":50},{"title":"2023-08-27","dataIndex":"yieldNum2023-08-27","key":"yieldNum2023-08-27","width":50},{"title":"2023-08-22","dataIndex":"yieldNum2023-08-22","key":"yieldNum2023-08-22","width":50},{"title":"2023-08-24","dataIndex":"yieldNum2023-08-24","key":"yieldNum2023-08-24","width":50},{"title":"2023-08-31","dataIndex":"yieldNum2023-08-31","key":"yieldNum2023-08-31","width":50},{"title":"2023-08-21","dataIndex":"yieldNum2023-08-21","key":"yieldNum2023-08-21","width":50},{"title":"2023-09-04","dataIndex":"yieldNum2023-09-04","key":"yieldNum2023-09-04","width":50},{"title":"2023-08-23","dataIndex":"yieldNum2023-08-23","key":"yieldNum2023-08-23","width":50},{"title":"2023-08-20","dataIndex":"yieldNum2023-08-20","key":"yieldNum2023-08-20","width":50},{"title":"2023-08-11","dataIndex":"yieldNum2023-08-11","key":"yieldNum2023-08-11","width":50},{"title":"2023-08-17","dataIndex":"yieldNum2023-08-17","key":"yieldNum2023-08-17","width":50},{"title":"2023-08-14","dataIndex":"yieldNum2023-08-14","key":"yieldNum2023-08-14","width":50},{"title":"2023-08-09","dataIndex":"yieldNum2023-08-09","key":"yieldNum2023-08-09","width":50}])
const [newData, setNewData] = useState([{"hardBinNum":"Unit Count","color":"transparent","key":0,"yieldNum2023-08-28":0,"yieldNum2023-08-19":0,"yieldNum2023-08-08":0,"yieldNum2023-08-18":0,"yieldNum2023-08-25":0,"yieldNum2023-08-12":0,"yieldNum2023-08-15":0,"yieldNum2023-09-03":0,"yieldNum2023-09-01":0,"yieldNum2023-08-10":0,"yieldNum2023-08-30":0,"yieldNum2023-08-16":0,"yieldNum2023-09-05":0,"yieldNum2023-08-29":0,"yieldNum2023-08-13":0,"yieldNum2023-08-07":0,"yieldNum2023-09-02":0,"yieldNum2023-08-26":0,"yieldNum2023-08-27":0,"yieldNum2023-08-22":0,"yieldNum2023-08-24":0,"yieldNum2023-08-31":0,"yieldNum2023-08-21":0,"yieldNum2023-09-04":0,"yieldNum2023-08-23":0,"yieldNum2023-08-20":0,"yieldNum2023-08-11":0,"yieldNum2023-08-17":0,"yieldNum2023-08-14":0,"yieldNum2023-08-09":0}]);

<DragSortTable
id = {'paretoTable'}
columns={newColumns}
dataSource={[...newData]}
bordered
pagination = {false}
size = 'small'
search={false}
dragSortKey="sort"
options={{
reload: false,
density: false
}}
rowKey ="key"
/>

Β© Version Info

  • ant-design/pro-components version 2.6.16
  • umi version
  • browser [chrome Version 116.0.5845.141 (Official Build) (64-bit)]
  • env [e.g. windows 10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant