Last week , i had some troubles when I was trying to replace the html rows.The issue that I encountered is , whenever you switch rows using innerHTML property , controls loose their values/

So what I find out using googling , is to use the insertBefore function of the DOM

To achieve the function of replacing the upper or lower rows of the table ;

row = GetRowReferenceBySomeHow();

tbody = GetBodyReference();// or you can simple use row.parentNode 

isUp = true ; // whatever you choose(true is cool always , we dont like false(s)!

 

if(isUp) 

 tbody.insertBefore( row.previousSibling,row);

else

   tbody.insertBefore( row, row.nextSibling );

 

Viole! Cool huh ? Actually , nothing is cool , but since we are geek ( or at least I am (not always ) ) !

 

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts

Comments

Paulo pt

Thursday, May 29, 2008 6:44 PM

Paulo

Nested parenthesis in text!
Very Geeky!!! Laughing

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

Friday, August 22, 2008 3:25 AM

Recycle

All successful software gets changed