chanan / BlazorStrap

Bootstrap 4 Components for Blazor Framework
https://blazorstrap.io
The Unlicense
910 stars 156 forks source link

BSDataTable #604

Closed jcullen89 closed 9 months ago

jcullen89 commented 9 months ago

I have the BSDataTable in a child component, and I pass in the List of objects as a parameter, when change a dropdown that will update this list the first time it works fine and FetchItems is run, however, when I change again the FetchItems will not run again, but as I have an if statement around that table I can see its been refreshed correctly, just the FetchItems is not been run again and the table is showing the first set of data. As anyone else come across this issue?

jbomhold3 commented 9 months ago

Make sure you have a @ref to the data table. Then run ref.Refresh() when you're changing from the dropdown. It sounds like you are relying on the state change of the parent control to update the data table. The data table isn't told to pull data each time it renders. It will only pull in updates when the Refresh method is called

jbomhold3 commented 9 months ago

see the Custom Filters section in the docs

jcullen89 commented 9 months ago

Make sure you have a @ref to the data table. Then run ref.Refresh() when you're changing from the dropdown. It sounds like you are relying on the state change of the parent control to update the data table. The data table isn't told to pull data each time it renders. It will only pull in updates when the Refresh method is called

@jbomhold3 Thanks for your feedback on this. That done the trick, Calling the Refresh you referred to on the OnParametersSetAsync of the child component, that has the table and it works perfectly. Thanks again.