View Single Post
Old 05-20-2004, 09:54 PM   PM User | #8
mamtakansal
New Coder

 
Join Date: Feb 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
mamtakansal is an unknown quantity at this point
Sure. I had variable number of rows with two fixed columns in the datatable. Here is what I did to remove the elements in the datatable:

Code:
   while (tablebody.hasChildNodes()) {   // while tbody has datarow elements
            tablebody.firstChild.firstChild.nodeValue = null;
            tablebody.firstChild.lastChild.nodeValue = null;
            while (tablebody.firstChild.hasChildNodes()) {
                tablebody.firstChild.removeChild(tablebody.firstChild.firstChild);
            }
            tablebody.removeChild(tablebody.firstChild);
        }
        datatable.removeChild(tablebody);
Hope it helps!

Last edited by liorean; 05-21-2004 at 01:14 PM.. Reason: [code]
mamtakansal is offline   Reply With Quote