JavaScript Reference/Event Handlers Reference/onRowsInserted — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:22, 26 мая 2010
Содержание
"onRowsInserted" Example
<html>
<head>
<title>Recordset Events</title>
<script for="myData" event="onrowsinserted">
alert("Inserted");
</script>
<script language="javascript">
function add(){
myData.recordset.AddNew();
}
</script>
</head>
<body>
<input id=cmdAdd type="button" value="add record" onclick="add();">
<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>
<tr>
<td>First Name</td>
<td><input id=firstname type=text datasrc=#myData datafld=firstname></td>
</tr>
<tr>
<td>Last Name</td>
<td><input id=lastname type=text datasrc=#myData datafld=lastname></td>
</tr>
</table>
<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,Yin
Jason,Lee
Tony,Zhang
-->
"onRowsInserted" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<applet> <object> |
| |<xml> |
+----------------+--------------------------------------------------------------+
"onRowsInserted" Properties
+----------------+--------------------------------------------------------------+
| Properties |altKey altLeft |
| |cancelBubble ctrlLeft |
| |qualifier reason |
| |recordset shiftLeft |
| |srcElement type |
+----------------+--------------------------------------------------------------+
"onRowsInserted" Syntax and Note
Note:
This event fires when inserting a row into the recordset of a databound object.
The datasrc and datafld attributes must be set.
The value of the datasrc attribute must reference an object in the page.