473,466 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to update data to clone row

26 New Member
HI everyone ,

i would like to know how to change data to clone row.
this is my javascript
data is an array.

Expand|Select|Wrap|Line Numbers
  1. function addRow(tableID,noOfRows,data) {
  2.  
  3.     var table = document.getElementById(tableID);
  4.  
  5.     var rowCount = table.rows.length-noOfRows;
  6.  
  7.     var row = table.insertRow(rowCount);
  8.  
  9.     addRowClone(tableID,noOfRows,data);
  10. //    count++;
  11. }
  12.  
  13. function addRowClone(tableID,noOfRows,data)
  14. {
  15.   var tblBody = document.getElementById(tableID).tBodies[0];
  16.  
  17.   for(i=0;i<noOfRows;i++) {
  18.       var newNode = tblBody.rows[1].cloneNode(true);
  19.       tblBody.appendChild(newNode);
  20.   } 
  21.  
  22.   addDataToRows(tableID,noOfRows,data);
  23.  
  24. }
  25.  
  26.  
  27. function addDataToRows(tableID,noOfRows,data) {
  28.  
  29.     var table = document.getElementById(tableID);
  30.  
  31.     var rowCount = table.rows.length-noOfRows;
  32.  
  33.     var row = table.?????
  34.     //?????????????????????
  35. }
Mar 26 '10 #1
1 1842
acoder
16,027 Recognized Expert Moderator MVP
Rather than 3 functions, you can do it in one.

If you want to add from data into the rows, access each input/cell separately and set the fields or whatever is required.

To help further, you'll need to provide an example of what the data array contains for a row.
Mar 28 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: MW | last post by:
For laptop users who have an ASP application running on their laptops - is there a way I can have it check when connected to the network (via the FSO lastmodifieddate) which files need to be...
1
by: Terry | last post by:
My Question is this, I'm having trouble getting the OleDbDataAdapter to Point to another connection string and pull the data out of the DataSet I created from the Excel Spread Sheet and Place it up...
14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
3
by: muchan | last post by:
I'm a C++ programmer now poking into C#. I wanted to write a snippet of code, equivalent of //--- C++ code --------------- #include <string> #include <vector> class obj { // a POD class...
1
by: Alex D. | last post by:
hi guys. I need to clone multiple times an object and I am succesfully cloning using the regular serialization process, using a MemoryStream. My problem is that after cloning the object more that...
16
by: Hamed | last post by:
Hello I am developing a utility to be reused in other programs. It I have an object of type Control (a TextBox, ComboBox, etc.) that other programmers use it in applications. they may set some...
9
bhcob1
by: bhcob1 | last post by:
Hey guys, 'Update or CancelUpdate without AddNew or Edit' On my database i keep occasionly get this error when i try and edit a field, it is not everytime. It will be working fine and then this...
5
by: DavidB | last post by:
I have a situation where a user needs to clone an existing BE database (stored on a server) to his local machine. Assume the followings... User goes into the database FE which has linked BE. ...
7
by: =?Utf-8?B?Sm9lbCBNZXJr?= | last post by:
I have created a custom class with both value type members and reference type members. I then have another custom class which inherits from a generic list of my first class. This custom listneeds...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.