how to clear table data.

Posted by Abhi_patil under JavaScript on 5/29/2009 | Views : 5902 | Status : [Member] | Replies : 5
i have used code to clear data is as follows

var otable=document.getElementById('tblInvalidNo');
while (otable.firstChild)
{
otable.removeChild(otable.firstChild);
}

///
this work fine when table contains data up to 5000...
if records are more than 5000 or 10000 then it hang the application.




Responses

Posted by: Vuyiswamb on: 5/29/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good afternoon

What exactly are you doing ? Do you want to Clear the whole Table ? if yes why do you loop and at the same time delete. Why dont you call a Sp that will truncate your table ?

Please explain Briefly.

Thank you for using Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi_patil on: 5/29/2009 [Member] Starter

Up
0
Down
i am doing code for ClearAll fields like clear label,clear textbox data..
clear table ...hide all ubneccessary labels...



Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Majith on: 5/29/2009 [Member] Starter

Up
0
Down
Greetings Abhi,

if you want use as a common method for clearing all labels and texts use the following script.

function deleteSelect(){
document.selection.clear();
}


Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 5/31/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning Abhi_patil

Wait wait Wait, please try to be Specific. Are you displaying data in Gridview and you want to clear data in the Gridview ? and when you say table you mean the Gridview's contents ?




Thank you for posting at Dotnetfunda
[Administrator]

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anup1252000 on: 8/2/2009 [Member] Starter

Up
0
Down
go through ur previous article on clearin the textbox using reset button.. i showed with an example..

https://wordpress.com/pages/anuphosur.wordpress.com

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response