'boundElements' Example : boundElements « Javascript Collections « JavaScript DHTML

Home
JavaScript DHTML
1.Ajax Layer
2.Data Type
3.Date Time
4.Development
5.Document
6.Dojo toolkit
7.Event
8.Event onMethod
9.Ext JS
10.Form Control
11.GUI Components
12.HTML
13.Javascript Collections
14.Javascript Objects
15.Javascript Properties
16.jQuery
17.Language Basics
18.Mochkit
19.Mootools
20.Node Operation
21.Object Oriented
22.Page Components
23.Rico
24.Scriptaculous
25.Security
26.SmartClient
27.Style Layout
28.Table
29.Utilities
30.Window Browser
31.YUI Library
JavaScript DHTML » Javascript Collections » boundElements 




'boundElements' Example

    
<html>
<head>
<title>Recordset Events</title>
<script language="javascript">
function rowEnter(){
    myTable.rows[myData.recordset.AbsolutePosition].style.backgroundColor = 'yellow';
}
function add(){
    myData.recordset.AddNew();
}
function del(){
    if (myData.recordset.RecordCount > 0
        myData.recordset.Delete();
}
</script>
<script for="myTable" event="onreadystatechange">
    if (this.readyState == 'complete'){
        this.rows(myData.recordset.AbsolutePosition).style.backgroundColor = 'yellow';
        myData.onrowenter = rowEnter;
    }
</script>
<script for="myData" event="onrowexit">
    for (var i = 1; i <= myData.recordset.RecordCount; i++) {
       myTable.rows[i].style.backgroundColor = '';
    }
</script>
<script for="tableList" event="onclick">
    myData.recordset.AbsolutePosition = this.recordNumber;
    window.event.cancelBubble = true;
</script>
<script for="myData" event="oncellchange">alert(event.boundElements(00).value);</ script>
</head>
<body>
<input id=cmdAdd type="button" value="ADD RECORD" onclick="add();">
<input id=cmdDelete type="BUTTON" value="DELETE" onclick="del();">
<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>
    </tr>    
    <tr>
        <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>
<!--  

Contents of myfile.csv:
firstname:string,lastname:string
John,Smith
Manny,Ramirez
Troy,Belling


-->

    
      
      














Related examples in the same category
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.