-
Notifications
You must be signed in to change notification settings - Fork 400
feat(DataTable): Add sorting params to header onClick callback #2083
feat(DataTable): Add sorting params to header onClick callback #2083
Conversation
Deploy preview for carbon-components-react ready! Built with commit 008e7c2 https://deploy-preview-2083--carbon-components-react.netlify.com |
hi @moczolaszlo it looks like CI is failing because the bundle size threshold needs to be increased https://github.com/IBM/carbon-components-react/blob/master/package.json#L365 on a side note, is there an associated issue for this pull request for additional context? |
* fix: update skeleton svg for progress indicator * chore: update html
Hi @emyarod |
onClick: composeEventHandlers([ | ||
this.handleSortBy(header.key), | ||
onClick | ||
? this.handleOnHeaderClick(onClick, header.key, sortDirection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to gather sortkey/sortdirection in an object here, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this?
this.handleOnHeaderClick(onClick, {
sortHeaderKey: header.key,
sortDirection,
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 - Thanks @moczolaszlo!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, thanks for doing this!
🎉 This PR is included in version 6.112.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi @moczolaszlo and @asudoh. I'm pretty new to React and Carbon. I'm trying to get both header's key and sort direction for my custom sort function. I have this
However, it seems that |
With this change the callback of DataTable header's onClick gives back the params of sorting as an object.
Like:
New