473,385 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to change the MousePointer while sorting a table

With
document.body.style.cursor = "wait";
I can set the hourglass and with
document.body.style.cursor = "default";
I can set the MousePointer back. That works great.

But if I do
document.body.style.cursor = "wait";
<sort the table>
document.body.style.cursor = "default";
I never see the MousePointer as a hourglass. I guess the problem is that the
MousePointer is only updated at the end of the javascript function.
Is there something like a refresh?

Stefan
Jan 24 '06 #1
6 4715
VK

Stefan Mueller wrote:
With
document.body.style.cursor = "wait";
I can set the hourglass and with
document.body.style.cursor = "default";
I can set the MousePointer back. That works great.

But if I do
document.body.style.cursor = "wait";
<sort the table>
document.body.style.cursor = "default";
I never see the MousePointer as a hourglass. I guess the problem is that the
MousePointer is only updated at the end of the javascript function.
Is there something like a refresh?


You have to let your document a micro-break for updates:

document.body.style.cursor = "wait";
setTimeout(mySortFunction);

function mySortFunction() {
....
....
document.body.style.cursor = "default";
}

Jan 25 '06 #2
VK wrote:
You have to let your document a micro-break for updates:

document.body.style.cursor = "wait";
setTimeout(mySortFunction);
Since when is the second argument of setTimeout() an optional one?
And using a function reference will indeed _break_ or not work in
older UAs, especially older IEs.
function mySortFunction() {
...
...
document.body.style.cursor = "default";
}

PointedEars
Jan 25 '06 #3
VK

Thomas 'PointedEars' Lahn wrote:
Since when is the second argument of setTimeout() an optional one?
Since always. It ensures the minumum time period available at the given
system (1 system tick) w/o needs to worry about the particualr system
type (Win98 ... Win XP, Mac, Linux)
And using a function reference will indeed _break_ or not work in
older UAs, especially older IEs.


The oldest IE still officially supported by Microsoft (and available
for download) is IE 5.5 SP2 for Windows. Any older IE's (as well as
IE's for Mac) are out of practical interest for anyone including
myself. It doesn't prevent personal proprietary choices (like you are
welcome to make NN 3.0 Gold - compliant solutions) but it is not a
subject of public consideration.

Jan 25 '06 #4
VK wrote:
Thomas 'PointedEars' Lahn wrote:
Since when is the second argument of setTimeout() an optional one?
Since always. It ensures the minumum time period available at the given
system (1 system tick) w/o needs to worry about the particualr system
type (Win98 ... Win XP, Mac, Linux)


Neither Netscape, which invented this method, nor Microsoft or the Mozilla
Organization and other implementors which copied the implementation, agree
with you:

<URL:http://e-pla.net/documents/manuals/javascript-1.0/ref_s-s.html#setTimeout_method>
<URL:http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/ref_s-s.htm#73328>
<URL:http://research.nihonsoft.org/javascript/jsref/win1.htm#1012029>
<URL:http://research.nihonsoft.org/javascript/ClientReferenceJS13/window.html#1203758>
<URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/settimeout.asp>
<URL:http://developer.mozilla.org/en/docs/DOM:window.setTimeout>
<URL:http://developer.kde.org/documentation/library/3.4-api/khtml/html/classKJS_1_1ScheduledAction.html>
<URL:http://webcvs.kde.org/khtmltests/ecma/settimeout.html?rev=1.2&view=auto>
And using a function reference will indeed _break_ or not work in
older UAs, especially older IEs.


The oldest IE still officially supported by Microsoft (and available
for download) is IE 5.5 SP2 for Windows.


Nevertheless my grandmother can use her Windows 98 SE with built-in IE 5.01
quite well. You do not want to force her (and the numerous other people
who do not want or cannot upgrade) to upgrade, do you?
Any older IE's (as well as IE's for Mac) are out of practical
interest for anyone including myself.
So you do not want my grandmother (and numerous other people that do not
want to or cannot upgrade) to buy stuff provided by you or your clients?
You deliberately want to decrease the profit margin for you or your
clients? Maybe there is something about selling you did not understand
properly yet.
It doesn't prevent personal proprietary choices (like you are
welcome to make NN 3.0 Gold - compliant solutions) but it is
not a subject of public consideration.


Not for incompetent people like you, that is for sure.
PointedEars
Jan 25 '06 #5
First of all thanks a lot for your solution. Until now it's still the only
solution I have and if it works then setTimeout is okay for me. But it
doesn't really work yet.

<html>
<body>
<script type = 'text/javascript'>
/*-------------------------------------------*/
function sorttable(var_text, var_number) {
document.body.style.cursor = "wait";
window.setTimeout("do_sorttable()", 1);
// window.setTimeout("do_sorttable(var_text, var_number)", 1);
}
/*-------------------------------------------*/
function do_sorttable() {
// function do_sorttable(var_text, var_number) {
for (i = 1; i < 2000000; i++) {
}

alert("Done.");
document.body.style.cursor = "default";
}
</script>

<input type = 'checkbox' name = 'my_ckeckbox' onClick =
'sorttable("abc", 123)'>
In Mozilla and Opera the MousePointer is only on this text an
hourglass and in Mozilla only after the alert box. Why that and how can I
solve that problem?
</body>
</html>
In Mozilla and Opera the MousePointer is not on the whole window an
hourglass and in Mozilla only after the alert box. Why that and how can I
solve that problem?

My second problem is that if I use
window.setTimeout("do_sorttable(var_text, var_number)", 1);
and
function do_sorttable(var_text, var_number) {
it doesn't work at all (Error: 'var_text' is undefined.

Stefan
Jan 25 '06 #6
Thomas 'PointedEars' Lahn posted the following on 1/25/2006 11:14 AM:
VK wrote:


<snip>
And using a function reference will indeed _break_ or not work in
older UAs, especially older IEs.

The oldest IE still officially supported by Microsoft (and available
for download) is IE 5.5 SP2 for Windows.


Nevertheless my grandmother can use her Windows 98 SE with built-in IE 5.01
quite well. You do not want to force her (and the numerous other people
who do not want or cannot upgrade) to upgrade, do you?


The same argument could be used for NN4 users then but I don't see you
professing to want to support NN4 though. Somewhere, you have to draw
the line on how far back you want to support a family of browsers.
Personally, IE5.5 is too old to be considered current and should be
dropped. IE5.0 goes without saying.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 25 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Doe | last post by:
et al, I've tried to find out on the 'net how to do this but can't seem to find it anywhere. How can I changed the cursors that show up in a windows application to be specific cursors that I...
2
by: Tippy G | last post by:
Can someone please give me an example of how to change the mousepointer to an hourglass or whatever other constant in VB.NET? I need to do it from a start-up module (VB6 days would have been...
4
by: Gareth Gale | last post by:
I'm trying to implement a way of allowing a user to sort a HTML table via Javascript on the client. I've seen lots of samples where single column sorting (asc or desc) is shown, but I'd like nested...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
10
by: OldBirdman | last post by:
On a Report, can I change any of the fields in the "Sorting and Grouping Dialog" from within Visual Basic??? Changing the OrderBy property of the Report doesn't change anything, nor does adding an...
2
by: cluce | last post by:
i have a table sorting feature on my website that works everywhere else except in firefox. but the example code does work in firefox. this has me stumped. The problem is the links in the table...
6
by: wil1cad2 | last post by:
I'm using VB studio 2005. Pls help to change cursor to HourGlass when u press a button and wait for calcualtion the result. Ex: If btnCalculate.Enabled = True Then ...
2
by: Bob Laubla | last post by:
Hello I have a very complex maketable query with many records and involving multiple VB functions which call other functions. I need this table to be sorted by the first field. But no matter what...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.