Open dclorena11 opened 5 years ago
There's a lot going on here. Can you pare this down to a single specific issue? Also, I could not load the codesandbox example, as it appears to error-out immediately.
There's a lot that has changed between the beta and the most recent version. It's likely that you will need to modify your code if you want to take advantage of the latest versions.
I'm fairly certain onTableChange
will still work for you, but you would likely have to modify it to maintain more of your state, as this is the direction the table is moving. We can't rely on internal derived state, unfortunately, as this means that no one can alter the data going in as props and benefit from react bindings. Additionally, you may want to reread the documentation, as there are a lot of features you might not be taking advantage of. For example, if you just need to make updates on filter change, then you've got a callback just for that: onFilterChange
. No need to use the generic onTableChange
in that case.
Expected Behavior
When we upgraded our version from
2.0.0-beta.58
to2.5.1
we found that changing state in the component re-rendered the whole table, but in the previous version it only seemed to re-render theTableBody
. When we filter withserverSide: false
we would like for only the TableBody to re-render and include filtered changes.Note: We also have are using
onTableChange
and acustomFooter
in ouroptions
.Current Behavior
Currently when we filter, whole table re-renders, check box column shows up on the left side of table, chips don't show on the top header, our
customFooter
doesn't not render correctly with totals, records don't filter.Steps to Reproduce (for bugs)
You'll see that a lot of complexity below is us trying to calculate the Quantity Submitted based on the filtered results we get
onTableChange
. We were so excited to have this work in a previous version, so sad that it's no longer supported. It seems like2.5.1
assumes you're usingonTableChange
for serverSide filtering. We tried usinguseRef
hooks to stop rendering without success. My attempt at reproducing in sandbox but copy pasting below as well..and customfooter
Your Environment
onTableChange
,serverSide:false
,customFooter
in table options