It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

how to identify the row of a table

how to identify the row of a table

Postby TechieRaj on Wed Jan 16, 2008 6:02 am

hi friend,
when user click a perticular row i want to add another row below to clicked row .....
pls help.
TechieRaj
 
Posts: 0
Joined: Thu Jan 10, 2008 5:43 am
Location: Bangalore

Postby leonard on Wed Jan 16, 2008 9:11 am

here's the trick:
Code: Select all
function cloneAfter(currentObj) {
   clonedObj = currentObj.cloneNode(true);
   parentObj = currentObj.parentNode;
   parentObj.appendChild(clonedObj);
   nextObj = currentObj.nextSibling;
   parentObj.insertBefore(clonedObj, nextObj);
}

And here's how it looks like:
http://devppl.chew.ch/DOM/cloneTableRow.html

cheers!
- leonard
:%s/^M//
There are 10 kinds of people:
Those who understand binary and those who don't.
User avatar
leonard
100+ Club
 
Posts: 147
Joined: Tue Dec 18, 2007 7:11 am
Location: Switzerland


Who is online

Users browsing this forum: No registered users and 3 guests