This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Deleting a row dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Deleting a row dynamically" Watch "Deleting a row dynamically" New topic
Author

Deleting a row dynamically

Arulanand Dayalan
Ranch Hand

Joined: Aug 10, 2005
Posts: 124
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

Joined: Nov 08, 2001
Posts: 15385
    
    6
Is this a delete as in remove from the users view or as in delete permanently from the Database?

Eric
Arulanand Dayalan
Ranch Hand

Joined: Aug 10, 2005
Posts: 124
Thanks Eric. Its jst enough for me to remove from the screen.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15385
    
    6
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

Joined: Aug 10, 2005
Posts: 124
Thanks a lot Eric that worked out.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Deleting a row dynamically
 
It's not a secret anymore!