You are here: Reference > JavaScript > client-side > event handling > events > onrowenter

onrowenter event | rowenter event

Browser support:
Occurs on a data source object when the current row in it has changed.
Use the onrowexit event to receive a notification before the current row changes.
For further details about data source objects, see the page for the recordset object.

How to register:

In HTML:
<ELEMENT onrowenter="handler">

In JavaScript:
object.onrowenter = handler;
object.attachEvent ("onrowenter", handler);
You can find the related objects in the Supported by objects section below.
The event object is accessible to all event handlers in all browsers. The properties of the event object contain additional information about the current event. To get further details about these properties and the possible event handler registration methods, please see the page for the event object.
For a complete list of events, see the page for Events in JavaScript.

Basic information:

Bubbles Yes
Cancelable No
Event object -

Actions that invoke the onrowenter event:

  • Changing the current row (e.g. by the MoveFirst, MoveLast, MoveNext or MovePrevious method of the recordset object or deleting the current row from the data source, ...)

The order of events related to the onrowenter event:

The onrowenter event occurs after the onrowexit event except when the current row was not an existing row (not initialized, pointing to the position before the first record (BOF is true) or after the last record (EOF is true)). In that case only the onrowenter event is fired.

Example HTML code 1:

This example illustrates the use of the onrowenter event:
<head>
    <script type="text/javascript">
        function DeleteRow () {
            var xml = document.getElementById ("movies");
            var xmlDoc = xml.XMLDocument;
            var movies = xmlDoc.getElementsByTagName ("movie");
            var firstMovie = movies[0];
            firstMovie.parentNode.removeChild (firstMovie);
        }

        function OnRowsDelete () {
            alert ('Rows will be deleted from the data source object!');
        }
        function OnRowExit () {
            alert ('The current row will change in the data source object!');
        }
        function OnRowEnter () {
            alert ('The current row has changed in the data source object!');
        }
    </script>
</head>
<body>
    <xml id="movies" onrowsdelete="OnRowsDelete ()" onrowexit="OnRowExit ();" onrowenter="OnRowEnter ();">
    <?xml version="1.0"?>
        <movies>
            <movie>
                <name>Clark Kent</name>
                <jobtitle>Superman</jobtitle>
                <born>1966</born>
            </movie>
            <movie>
                <name>Lois Lane</name>
                <jobtitle>Reporter</jobtitle>
                <born>1964</born>
            </movie>
        </movies>
    </xml>

    <table id="myTable" width="100%" cellpadding="0px" cellspacing="2px" border="1px" datasrc="#movies" datapagesize="3">
        <thead>
            <tr>
                <th>Name</th>
                <th>Jobtitle</th>
                <th>Born</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><span datafld="name"></span></td>
                <td><span datafld="jobtitle"></span></td>
                <td><span datafld="born"></span></td>
            </tr>
        </tbody>
    </table>
    <br />
    <button onclick="DeleteRow ();">Delete the first row from the data source!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content