Skip to main content

Bug Tracker

Side navigation

#10887 closed bug (invalid)

Opened November 24, 2011 03:31PM UTC

Closed November 24, 2011 05:59PM UTC

bug:delete row error

Reported by: luxz@neusoft.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
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();

}

Attachments (0)
Change History (2)

Changed November 24, 2011 03:32PM UTC by anonymous comment:1

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>

Changed November 24, 2011 05:59PM UTC by ajpiano comment:2

resolution: → invalid
status: newclosed

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