aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Making current thread sleep in JS for progress bar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Making current thread sleep in JS for progress bar" Watch "Making current thread sleep in JS for progress bar" New topic
Author

Making current thread sleep in JS for progress bar

sandeep Kumar
Ranch Hand

Joined: Sep 19, 2007
Posts: 41
Hi All,

I am using a Dojo SortableTable in my application.When I perform some search on one of the columns, datta will be populated from data base. During this elapsed time, A progress bar is shown.

The problem is after getting the data to the browser, it performs a parse on the data, this parsing takes lot of time during which the progress bar is just stable for considerable amount of time.

So I wanted to make current thread sleep in the parse function of JS during iterations. I hope during that sleep time, the CPU time would be given to the progress bar.

If any one has got some information, please suggest me.

Thanks in Advance.

Regards,
Sandeep.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

JavaScript has no concept of threading.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sandeep Kumar
Ranch Hand

Joined: Sep 19, 2007
Posts: 41
Hi Bear Bibeault,

First of all Thanks for your response.
But is there any way I could make my progress bar move during parsing?

Thanks/Sandeep.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

When the script is busy doing one thing, all else is blocked.
 
Don't get me started about those stupid light bulbs.
 
subject: Making current thread sleep in JS for progress bar