Title: $.messager.progress and ajax Post by: Juan Antonio Martínez on October 25, 2018, 05:40:43 AM Hello.
I think this is a classic problem, but don't know the right way to solve Need to show a progressbar and hide it when an ajax call gets done (either success or fail). In some scenarios ajax call finishes _before_ progressbar is shown, thus the progress bar never closes. Whats the right way to write this code? Code: function doSomeThingWithAjax() { Thanks in advance Juan Antonio Title: Re: $.messager.progress and ajax Post by: stworthy on October 25, 2018, 05:12:23 PM Display the message dialog in 'beforeSend' and close it in 'complete'. Please refer to the code below:
Code: $.ajax({ Title: Re: $.messager.progress and ajax Post by: Juan Antonio Martínez on October 26, 2018, 01:09:01 AM Mmmmh doesn't work for me :-(. The problem is that $.messager.progress fires up an async task (timer) to handle its internals
Also, I use a global beforeSend options for every ajax calls to insert special headers, so no easy way of insert specific messages into each progress bar and/or omit them on ajax calls that doesn't need progressbar This seems to work fine: Code: function doSomeThingWithAjax() { |