You are here: Reference > JavaScript > client-side > ActiveX > ADO > methods > lastPage (table)

lastPage method (table)

Browser support:
Displays the last page of records from the data set that the current table object is bound to.
The number of records in a page must be specified to use this method (see the dataPageSize property).
This method belongs to the Internet Explorer data binding techniques; other browsers don’t support any similar functionality.

Syntax:

object.lastPage ( );
You can find the related objects in the Supported by objects section below.

Return value:

This method has no return value.

Example HTML code 1:

This example illustrates the use of the lastPage method:
<head>
    <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>
</head>
<body>
    <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>
                <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