You are here: Reference > JavaScript > client-side > ActiveX > ADO > properties > recordNumber

recordNumber property

Browser support:
Returns an integer value that indicates the ordinal position of the item within the data set that generated the current object.
This property can be used, if the object is created with data binding techniques.

Syntax:

object.recordNumber;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Integer that retrieves the ordinal position.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the recordNumber property:
<head>
    <script type="text/javascript" for="myTr" event="onclick">
        alert ("This is the " + this.recordNumber + ". record in the data set.");
    </script>
</head>
<body>
    <xml id="movies">
        <?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>
            <movie>
                <name>Fred Flintstone</name>
                <jobtitle>Caveman</jobtitle>
                <born>1970</born>
            </movie>
            <movie>
                <name>Barney Rubble</name>
                <jobtitle>Caveman</jobtitle>
                <born>1972</born>
            </movie>
        </movies>
    </xml>

    <b>Click a row in the Table to get its recordNumber!<b>
    <table width="100%" cellpadding="0px" cellspacing="2px" border="1px" datasrc="#movies" datapagesize="1" id="myTable">
        <thead>
            <tr>
                <th>Name</th>
                <th>Jobtitle</th>
                <th>Born</th>
            </tr>
        </thead>
        <tbody>
            <tr id="myTr">
                <td><span datafld="name"></span></td>
                <td><span datafld="jobtitle"></span></td>
                <td><span datafld="born"></span></td>
            </tr>
        </tbody>
    </table>

    <input type="button" onclick="myTable.firstPage ()" value="|< First " />
    <input type="button" onclick="myTable.previousPage ()" value="< Previous " />
    <input type="button" onclick="myTable.nextPage ()" value=" Next >" />
    <input type="button" onclick="myTable.lastPage ()" value=" Last >|" />
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content