By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,463 Members | 3,115 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,463 IT Pros & Developers. It's quick & easy.

body.style.cursor='wait' problem

P: n/a
Hi,
I would like to ask for your help (I am using only IE5.5).

I have a very big table that I would like to sort.
During the sort I would like the cursor changed to 'wait' state and
back to default state when the sort is over.

The first row of table displays the columns titles when each cell (TD)
contain link to a sort function (sortTable).
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=0 name="meridCfgTable"
WIDTH=100% id=meridCfgTable >
<TR align="center">
<TD class=MERIDCFGTITLE>
<A CLASS=MERIDCFGTITLE HREF="javascript:sortTable(0,
meridCfgTable);">ID</A></TD>

function sortTable(col, tableToSort,stt)
{
document.body.style.cursor = 'wait';
window.setTimeout(function(){sortTableAfterWait(co l,
tableToSort);}, 1000);
}

function sortTableAfterWait(col, tableToSort)
{

// The table sorting process
document.body.style.cursor = 'default';
}
The problems are:

1. Sometimes the cursor is not being changed during the sort (even if
I enlarge the delay to 5000 ms).

2. Sometimes the cursor is changed but does not return to the
'default' state unless I move the mouse after the sort is finished.
I.e. the user can't tell when the sort is over without moving the
cursor.

Any solutions?

Thanks,

Yaron

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ivo
"Yaron Cohen" <ya****@lyciumnetworks.com> wrote
I have a very big table that I would like to sort.
During the sort I would like the cursor changed to 'wait' state and
back to default state when the sort is over.

The problems are:

1. Sometimes the cursor is not being changed during the sort (even if
I enlarge the delay to 5000 ms).

2. Sometimes the cursor is changed but does not return to the
'default' state unless I move the mouse after the sort is finished.
I.e. the user can't tell when the sort is over without moving the
cursor.
<TABLE name="meridCfgTable" WIDTH=100% id=meridCfgTable >
" Quotes " are required around the 100% and recommended around the id value.
<TR align="center">
<TD class=MERIDCFGTITLE>
<A CLASS=MERIDCFGTITLE HREF="javascript:sortTable(0,
meridCfgTable);">ID</A></TD>
Don't use href="javascript:..." but onclick="..."
<A CLASS=MERIDCFGTITLE HREF="#" onclick="sortTable(0,meridCfgTable);">
function sortTable(col, tableToSort,stt)
{
document.body.style.cursor = 'wait';
window.setTimeout(function(){sortTableAfterWait(co l,
tableToSort);}, 1000);
No need to declare a new function: setTimeout expects a sting iirc:
window.setTimeout("sortTableAfterWait("+col+","+ta bleToSort+");", 1);
}

function sortTableAfterWait(col, tableToSort)
{

// The table sorting process
document.body.style.cursor = 'default';
}

Thanks,

Yaron


Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.