Bug Tracker

Modify

Ticket #10887 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

bug:delete row error

Reported by: luxz@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

I want to delete a row in table which lay another table's td. like this: <table id="tb1">

<tr id="tr1">

<td>

<table id="tb2">

<tr id="tr2">

<td><input type="button" onclick="delel(this)" value="delete"/></td>

</tr>

</td>

</tr>

</table>

function delel(ele) {

I want to delete <tr id="tr2">... But infact, <tr id="tr1"... was deleted. how to resolve it? $(ele).parents("tr").remove();

}

Change History

comment:1 Changed 2 years ago by anonymous

I want to delete a row in table which lay another table's td. like this: <table id="tb1">

<tr id="tr1">

<td>

<table id="tb2">

<tr id="tr2">

<td><input type="button" onclick="delel(this)" value="delete"/></td>

</tr>

</td>

</tr>

</table> <script type="text/javascript"> function delel(ele) {

I want to delete <tr id="tr2">... But infact, <tr id="tr1"... was deleted. how to resolve it? $(ele).parents("tr").remove();

} </script>

comment:2 Changed 2 years ago by ajpiano

  • Status changed from new to closed
  • Resolution set to invalid

Use  closest

$(this).closest("tr").remove();

You get one freebie for Thanksgiving, but this tracker is *not* a support venue and in the future, please use the  forum

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.