imballinst / react-bs-datatable

Bootstrap datatable without jQuery. Features include: filter, sort, pagination, checkbox, and control customization.
https://imballinst.github.io/react-bs-datatable
MIT License
60 stars 20 forks source link

feat: implement `tableEventsRef` for calling control events outside of the uncontrolled table #126

Closed imballinst closed 2 years ago

imballinst commented 2 years ago

This follows the idea in https://github.com/imballinst/react-bs-datatable/pull/123#issuecomment-1050421625, with 1 change:

  1. Use onSortByPropChange to be passed to the useImperativeHandle and keep onSortChange as it is. This is because, if we change onSortChange, then it will be a breaking change.

I tried a different approach to use a hook outside of DatatableWrapper, but the changes were quite big and of course, breaking. I don't want to make the table API unstable, so I'll leave it for the future.

Signed-off-by: Try Ajitiono ballinst@gmail.com