This topic is locked

Throbber ("Loading...") Options Needed

4/8/2020 9:58:41 PM
ASPRunner.NET General questions
joglidden author

In ASPR.NET 10.3, there is the option to enable a throbber (referred to in ASPR as Display "Loading..." box on the list page). It's the spinning, animated icon that indicates to the user that the computer (somewhere) is performing an action in the background. However, this option only exists when loading list pages.
It would be nice if we could somehow load and run a throbber before some of the other page actions. Specifically, when clicking the 'Edit record' or 'View record' icons in a list view, it would be nice to have a throbber run before the edit or view page pops up. The problem is that if there is more than a second or two of delay from the click to the popup rendering, the user will keep clicking the icon, and then by the time the query runs and the edit or view popup renders, they've clicked five times and might have five popups. A spinning throbber would tell the user to wait and prevent them from clicking again. Or even a message displayed ("Please wait...") would be good.
I've thought about enabling this in events, but I quite can't see how to do it. If anyone has done this, or has any advice about approaching the problem, I'd appreciate the suggestion.

Pete K 4/10/2020

Here's a simple approach I took. Adding the following code to the custom_functions.js event will add it to every page in your project. This will display the "spinning wheel" cursor when a user clicks a link to any other page.



// Display spinning wheel whenever leaving page while waiting for next page to load

$(window).on('beforeunload', function(){

$('*').css("cursor", "progress");

});


joglidden author 4/12/2020

Ok, I tried that, and I didn't see a throbber appear. I wonder how your Add, Edit, View pages are configured.
For a particular custom view of a database table, if you go to Pages, and then under 'List Page' settings, under 'Show in popup', I have all three 'Add page', 'Edit page', and 'View page' checked. I wonder if you have these unchecked, and therefore when you go to the Add/Edit/View page, it advances to that page.
Thanks for the suggestion. I'll keep experimenting with it.

joglidden author 4/12/2020



Ok, I tried that, and I didn't see a throbber appear. I wonder how your Add, Edit, View pages are configured.
For a particular custom view of a database table, if you go to Pages, and then under 'List Page' settings, under 'Show in popup', I have all three 'Add page', 'Edit page', and 'View page' checked. I wonder if you have these unchecked, and therefore when you go to the Add/Edit/View page, it advances to that page.
Thanks for the suggestion. I'll keep experimenting with it.


Ok Pete, yes that does work, and it's a great improvement. However, it only works in page navigation, not between Add/Edit/View icon click events (on a list page) and Add/Edit/View popup rendering. Obviously these are very different navigation events, so my search continues. Thanks again.