JavaScript DHTML/Table/Data Page

Материал из Web эксперт
Версия от 07:28, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Get previous Page Example

    
<html>
<head>
<script language="javascript">
function goFirst(){
   document.all.myTable.dataPageSize = 2;
   myTable.firstPage(); 
} 
function goPrevious(){
   document.all.myTable.dataPageSize = 2;
   myTable.previousPage(); 
}
function goNext(){
   document.all.myTable.dataPageSize = 2;
   myTable.nextPage(); 
}
function goLast(){
   document.all.myTable.dataPageSize = 2;
   myTable.lastPage(); } </script>
<body>
<button onclick="goFirst();">First Page</button>
<button onclick="goPrevious();">Previous Page</button>
<button onclick="goNext();">Next Page</button>
<button onclick="goLast();">Last Page</button>
<button onclick="alert(document.all.myData.namedRecordset(""));">Named recordset</ 
button>
<object classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" id="myData">
    <param name="DataURL" value="myfile.csv">
    <param name="UseHeader" value="True">
    <param name="TextQualifier" value=""">
</object>
<table id="myTable" datasrc="#myData">
    <thead>
    <tr style="font-weight:bold">
       <td>First</td>
       <td>Last</td>
    </tr>
    </thead>
<tbody>
<tr id="tableList">
   <td><span datafld="firstname"></span></td>
   <td><span datafld="lastname"></span></td>
</tr>
</tbody>
</table>
</body></html>
<!-- myfile.csv-->
<!-- 
firstname:STRING,lastname:STRING
Joe,Smith
Manny,LastName
Tony,Belling
-->



Get the first Page

<html>
<head>
<script language="javascript">
function goFirst(){
   document.all.myTable.dataPageSize = 2;
   myTable.firstPage(); 
} 
function goPrevious(){
   document.all.myTable.dataPageSize = 2;
   myTable.previousPage(); 
}
function goNext(){
   document.all.myTable.dataPageSize = 2;
   myTable.nextPage(); 
}
function goLast(){
   document.all.myTable.dataPageSize = 2;
   myTable.lastPage(); 
} 
</script>
<body>
<button onclick="goFirst();">First Page</button>
<button onclick="goPrevious();">Previous Page</button>
<button onclick="goNext();">Next Page</button>
<button onclick="goLast();">Last Page</button>
<button onclick="alert(document.all.myData.namedRecordset(""));">
Named recordset
</button>
<object classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" id="myData">
    <param name="DataURL" value="myfile.csv">
    <param name="UseHeader" value="True">
    <param name="TextQualifier" value=""">
</object>
<table id="myTable" datasrc="#myData">
<thead>
    <tr style="font-weight:bold">
        <td>First</td>
        <td>Last</td>
    </tr>
</thead>
<tbody>
<tr id="tableList">
   <td><span datafld="firstname"></span></td>
   <td><span datafld="lastname"></span></td>
</tr>
</tbody>
</table>
</body>
</html>
 
<!-- myfile.csv-->
<!-- 
firstname:STRING,lastname:STRING
Joe,Smith
Manny,LastName
Tony,Belling
-->



GEt the last Page

    
<html>
<head>
<script language="javascript">
function goFirst(){
   document.all.myTable.dataPageSize = 2;
   myTable.firstPage(); 
} 
function goPrevious(){
   document.all.myTable.dataPageSize = 2;
   myTable.previousPage(); 
}
function goNext(){
   document.all.myTable.dataPageSize = 2;
   myTable.nextPage(); 
}
function goLast(){
   document.all.myTable.dataPageSize = 2;
   myTable.lastPage(); } </script>
<body>
<button onclick="goFirst();">First Page</button>
<button onclick="goPrevious();">Previous Page</button>
<button onclick="goNext();">Next Page</button>
<button onclick="goLast();">Last Page</button>
<button onclick="alert(document.all.myData.namedRecordset(""));">Named recordset</ 
button>
<object classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" id="myData">
    <param name="DataURL" value="myfile.csv">
    <param name="UseHeader" value="True">
    <param name="TextQualifier" value=""">
</object>
<table id="myTable" datasrc="#myData">
    <thead>
        <tr style="font-weight:bold">
            <td>First</td>
            <td>Last</td>
        </tr>
    </thead>
<tbody>
<tr id="tableList">
   <td><span datafld="firstname"></span></td>
   <td><span datafld="lastname"></span></td>
</tr>
</tbody>
</table>
</body>
</html>
    
    
<!-- myfile.csv-->
<!-- 
firstname:STRING,lastname:STRING
Joe,Smith
Manny,LastName
Tony,Belling
-->



Get the next Page Example

    
<html>
<head>
<script language="javascript">
function goFirst(){
   document.all.myTable.dataPageSize = 2;
   myTable.firstPage(); 
} 
function goPrevious(){
   document.all.myTable.dataPageSize = 2;
   myTable.previousPage(); 
}
function goNext(){
   document.all.myTable.dataPageSize = 2;
   myTable.nextPage(); 
}
function goLast(){
   document.all.myTable.dataPageSize = 2;
   myTable.lastPage(); } </script>
<body>
<button onclick="goFirst();">First Page</button>
<button onclick="goPrevious();">Previous Page</button>
<button onclick="goNext();">Next Page</button>
<button onclick="goLast();">Last Page</button>
<button onclick="alert(document.all.myData.namedRecordset(""));">Named recordset</ 
button>
<object classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" id="myData">
    <param name="DataURL" value="myfile.csv">
    <param name="UseHeader" value="True">
    <param name="TextQualifier" value=""">
</object>
<table id="myTable" datasrc="#myData">
<thead>
    <tr style="font-weight:bold">
        <td>First</td>
        <td>Last</td>
    </tr>
</thead>
<tbody>
<tr id="tableList">
   <td><span datafld="firstname"></span></td>
   <td><span datafld="lastname"></span></td>
</tr>
</tbody>
</table>
</body>
</html>
   
<!-- myfile.csv-->
<!-- 
firstname:STRING,lastname:STRING
Joe,Smith
Manny,LastName
Tony,Belling
-->