Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deleting a row dynamically

 
Arulanand Dayalan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have table wihich is created dynamically. It has check box has one column and Some Name field has another column. It value of the checkbox is the id of the Name column. I need to delete certain rows which matches a criteria. I can iterate througn the checkboxes array and find out which needs to be deleted. But i dont knw how to delete that row, that is i dont know how to get the row now of the particular row.

Can anyone help me in solving this.
Thanks in advance.

Regards,
Arul.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a delete as in remove from the users view or as in delete permanently from the Database?

Eric
 
Arulanand Dayalan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric. Its jst enough for me to remove from the screen.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well we can just change the display of the row to none which will hide it.

document.getElementById("theRowId").style.display = "none";

That will hide it from the user's view. Now if you want to totally get rid of it. You can try:

var row = document.getElementById("theRowId");
var table = document.getElementById("theTableId").
table.deleteRow(row);

That should get you started.

Eric
 
Arulanand Dayalan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Eric that worked out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic