progress indicator on page.

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

progress indicator on page.

#1

Postby xren » Tue Apr 02, 2013 5:56 pm

Hi,

I would like to add a progress indicator on a page. e.g. on a search page, click a button to search from DB, then display the result.

It may take a long time for the search to finish. I would like to show a progress indicator to let user know the action is in place, the result will show up soon.

How can this be done?

Thanks,
Xiaoli
0 x

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#2

Postby Steve » Wed Apr 03, 2013 4:01 pm

Hi Xiaoli,

You should set the cursor to progress when you click the button.

Code: Select all

$("*").css("cursor", "progress");
Just remember to return it afterwards:

Code: Select all

$("*").css("cursor", "auto");
Steve
0 x

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#3

Postby xren » Wed Apr 03, 2013 8:38 pm

Thank you Steve. This is exactly what I need. :)
0 x

geadon
Ebase User
Posts: 67
Joined: Wed Aug 15, 2012 1:22 pm

#4

Postby geadon » Wed Jun 26, 2013 2:25 pm

Hi,

Would you be able to advise me where I could put the code to return the cursor back to "auto"? I have a search button which when clicked fetches a database resource. Once the resource has been retrieved, the cursor should return to default but I'm not sure where to place the code.

Any advise would be much appreciated.
0 x

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#5

Postby Steve » Thu Jun 27, 2013 8:36 am

Hi geadon,

If you have Ajax switched off on your form (Form Properties), then the cursor will automatically change for you.

If you have Ajax switched on, then you should be able to change the cursor back after the task you are doing is completed.

e.g

Code: Select all

function doSomething()
{
  try
  {
     $("*").css("cursor", "progress"); //set cursor
     //execute some code here and do something
  }
  finally
  {
     $("*").css("cursor", "auto"); //finish
  }
}
Kind regards

Steve
0 x

geadon
Ebase User
Posts: 67
Joined: Wed Aug 15, 2012 1:22 pm

#6

Postby geadon » Thu Jun 27, 2013 12:13 pm

Thank you for your advice.
0 x


Who is online

Users browsing this forum: No registered users and 9 guests