wenzhixin / bootstrap-table

An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation, Vue.js)
https://bootstrap-table.com/
MIT License
11.74k stars 4.44k forks source link

Improve check to hide loadingTemplate #7490

Closed dheldt closed 1 month ago

dheldt commented 2 months ago

Description

Currently, the check if the loadingTemplate is hidden is based on an if-statement, checking if the (re-)loading is silent. Please adept this to check, if the loadingTemplate is visible.

Background: The last three days i did debug an app, where we have a slow server response (~10 seconds due to a huge database and complicated filters). The app auto-reloads silently, but the initial load is not.

The first reload was triggered (sometimes) before the initial load was completed. In this cases, the check to remove the loadingTemplate failed (it was visible due to the intial load not being completed, but the silent reload set the corresponding setting to silent). So the loadingTemplate was never hidden an no data were visible.

I guess it is not to hard to check, if it is visible, instead of relying on the setting, which might have been changed?

Surely, the issue i debugged was in my code by reloading to early, still I think bootstrap-table can be improved here to be more reliant (and prevent maybe somebody else some debugging-time).

thank you!

with kind regards,

daniel

wenzhixin commented 2 months ago

Please provide an Online Example to show your problem. Thanks!

wenzhixin commented 1 month ago

For this issue, I believe you should wait for the initial request to complete before making the next request rather than continuously sending requests. The load-success and load-error events can determine whether the request has been completed. If it has not, the queryParams option can return false to stop the next request.

I hope to help.