body.style.cursor='wait' problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yaron Cohen

    body.style.cursor='wait' problem

    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="meridCfgT able"
    WIDTH=100% id=meridCfgTabl e >
    <TR align="center">
    <TD class=MERIDCFGT ITLE>
    <A CLASS=MERIDCFGT ITLE HREF="javascrip t:sortTable(0,
    meridCfgTable); ">ID</A></TD>
    …


    function sortTable(col, tableToSort,stt )
    {
    document.body.s tyle.cursor = 'wait';
    window.setTimeo ut(function(){s ortTableAfterWa it(col,
    tableToSort);}, 1000);
    }

    function sortTableAfterW ait(col, tableToSort)
    {

    // The table sorting process
    document.body.s tyle.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





  • Ivo

    #2
    Re: body.style.curs or='wait' problem

    "Yaron Cohen" <yaronc@lyciumn etworks.com> wrote[color=blue]
    > 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="meridCfgT able" WIDTH=100% id=meridCfgTabl e >[/color]

    " Quotes " are required around the 100% and recommended around the id value.
    [color=blue]
    > <TR align="center">
    > <TD class=MERIDCFGT ITLE>
    > <A CLASS=MERIDCFGT ITLE HREF="javascrip t:sortTable(0,
    > meridCfgTable); ">ID</A></TD>[/color]

    Don't use href="javascrip t:..." but onclick="..."
    <A CLASS=MERIDCFGT ITLE HREF="#" onclick="sortTa ble(0,meridCfgT able);">
    [color=blue]
    > function sortTable(col, tableToSort,stt )
    > {
    > document.body.s tyle.cursor = 'wait';
    > window.setTimeo ut(function(){s ortTableAfterWa it(col,
    > tableToSort);}, 1000);[/color]

    No need to declare a new function: setTimeout expects a sting iirc:
    window.setTimeo ut("sortTableAf terWait("+col+" ,"+tableToSort+ ");", 1);
    [color=blue]
    > }
    >
    > function sortTableAfterW ait(col, tableToSort)
    > {
    >
    > // The table sorting process
    > document.body.s tyle.cursor = 'default';
    > }
    >
    > Thanks,
    >
    > Yaron
    >
    >
    >
    >
    >[/color]


    Comment

    Working...