dxc-technology / halstack-react

Library of components for building SPAs with React and Halstack Design System
https://developer.dxc.com/halstack/
Apache License 2.0
15 stars 14 forks source link

DXCResultSetTable, Sorting issue #2013

Closed jangirkamal123 closed 3 months ago

jangirkamal123 commented 3 months ago

Describe the bug table having a column with having values of "date string" formatted in 'MM/dd/yyyy'. Sorting on this column is working but the arrow of direction on column header is opposite the operation or vice-versa. this is working correct with string and number values but having issue with date.

To Reproduce add date string in sort value in resultsettable. like '01/01/1900', '01/02/1902', '01/01/1901'. the order of sorting is correct but the arrow of direction is incorrect.

github-actions[bot] commented 3 months ago

Thank you for opening an issue! 🚀

Our team will review it as soon as possible. In the meantime, please make sure that you've provided all the necessary details to help us understand and address the issue effectively.

Feel free to contribute and participate in discussions!

Jialecl commented 3 months ago

Hello @jangirkamal123 ,

To correctly sort date values use Date objects as sorting values instead of strings.

jangirkamal123 commented 3 months ago

image

image

the code arrangement as you suggested, is not working in grid

jangirkamal123 commented 3 months ago

() => { const columns = [ { displayValue: "Id", isSortable: false }, { displayValue: "Name", isSortable: true }, { displayValue: "City", isSortable: false }, { displayValue: "Actions", isSortable: false }, ];

const rows = [ [ { displayValue: "001", sortValue: "001" }, { displayValue: '06/14/2024', sortValue: new Date('06/14/2024') }, { displayValue: "Miami", sortValue: "Miami" }, { displayValue: }, ], [ { displayValue: "002", sortValue: "002" }, { displayValue: '06/19/2024', sortValue: new Date('06/19/2024') }, { displayValue: "London", sortValue: "London" }, { displayValue: }, ], [ { displayValue: "003", sortValue: "003" }, { displayValue: '06/17/2024', sortValue: new Date('06/17/2024') }, { displayValue: "Amsterdam", sortValue: "Amsterdam" }, { displayValue: }, ], ];

return (

); }

Jialecl commented 3 months ago

Hello @jangirkamal123 ,

We fixed this issue, it will be included in our next version.

Thanks