body.style.cursor='wait' problem

Y

Yaron Cohen

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(col,
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
 
I

Ivo

Yaron Cohen said:
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="..."
function sortTable(col, tableToSort,stt)
{
document.body.style.cursor = 'wait';
window.setTimeout(function(){sortTableAfterWait(col,
tableToSort);}, 1000);

No need to declare a new function: setTimeout expects a sting iirc:
window.setTimeout("sortTableAfterWait("+col+","+tableToSort+");", 1);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top