Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Show Hourglass during execution

    I have an HTML table with an XML data island as its datasrc. When the user clicks the table's column headers, a javascript function that sorts the table by that column executes. This sometimes takes a while (30 seconds?) because there may be a lot of data in the table. I would like to show an hourglass or a "Loading.." message while the function executes. I tried putting the script "document.body.style.cursor='wait';" before the sort function call in the onclick event but the cursor didn't actually change to an hourglass until the code of the sort function finished executing. Is there any way for me to force the hourglass to appear WHILE the sort function is executing?

  2. #2
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Show Hourglass during execution

    I solved this issue to reasonable satisfaction by putting the cursor-changing code in the onmousedown event which occurs before the onclick event. Then, at the end of the sorting function called by the onclick event, I change the cursor back to normal.

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Show Hourglass during execution

    Thanks for posting your solution, TJ. I'll keep that in mind in case I come across a similar issue in the future.

  4. #4
    New Lounger
    Join Date
    Mar 2005
    Location
    Salem, Oregon, USA
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Show Hourglass during execution

    I use this script to add an hourglass when you push a button -- and it changes the button to say working

    Sub SetWait()
    Dim i
    For i =0 to document.all.length -1
    If document.all(i).id = "submit1" Then
    document.all(i).value = "Working"
    Else
    document.all(i).style.cursor = "wait"
    End If
    Next
    End Sub

    Use this with the button input

    <Input type=submit value = "Submit" id=submit1 name=submit1 onclick="SetWait()">

    Chris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •