dynamically added row does not delete

Pshah

I have tried various options for deleting dynamically added rows, like .on and .live, but still haven't been able to delete the newly added rows.

And I came across this JSFiddle

Partial JS code:

$(".deleterow").on("click", function(){
    var $killrow = $(this).parent('tr');
    $killrow.addClass("danger");
    $killrow.fadeOut(2000, function(){
        $(this).remove();
    });
});

but it also has the same issue.

Can someone please point out what am I missing in this JSFiddle?

Thanks.

Unknown

use Event Delegation to register the click event handler to the dynamically created rows. Try this:

$(".container").on('click','.deleterow', function(){
var $killrow = $(this).parent('tr');
    $killrow.addClass("danger");
$killrow.fadeOut(2000, function(){
    $(this).remove();
});
});

DEMO

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Delete a dynamically added table row

From Dev

Dynamically added element will not delete

From Dev

Delete a row added with append

From Dev

Jquery, delete dynamically added content

From Dev

Delete dynamically added TinyMCE textboxes with dynamically added button

From Dev

Delete textbox tagged to button when dynamically added

From Dev

Can't delete dynamically added colon

From Dev

Delete a dynamically created table row

From Dev

search dynamically created row and delete

From Dev

Hover effect on dynamically added table row

From Dev

javascript change color of a dynamically added row

From Dev

How to do calculation in dynamically added row

From Dev

option change in Row added dynamically not responding

From Dev

Adding onclick function on a dynamically added table row

From Dev

Hover effect on dynamically added table row

From Dev

knockoutjs hasfocus implementation on dynamically added row

From Dev

Row delete does not work

From Dev

Laravel Trying to delete MySQL row that was added last

From Dev

jQuery Copy dynamically added table row values into next row

From Dev

Jquery click does not working with dynamically added link

From Dev

To delete a row dynamically from a table using javascript

From Dev

How to delete dynamically added item from sortable list?

From Dev

unable to delete dynamically added form fields using angular js

From Dev

JPA does not delete database row

From Dev

JPA does not delete database row

From Dev

Removing dynamically added row from a table using jquery

From Dev

How to add row numbers to rows added dynamically to a html table

From Dev

Datatables responsive doesn't apply to dynamically added row

From Dev

How to count number of rows in a table when table row is added dynamically

Related Related

  1. 1

    Delete a dynamically added table row

  2. 2

    Dynamically added element will not delete

  3. 3

    Delete a row added with append

  4. 4

    Jquery, delete dynamically added content

  5. 5

    Delete dynamically added TinyMCE textboxes with dynamically added button

  6. 6

    Delete textbox tagged to button when dynamically added

  7. 7

    Can't delete dynamically added colon

  8. 8

    Delete a dynamically created table row

  9. 9

    search dynamically created row and delete

  10. 10

    Hover effect on dynamically added table row

  11. 11

    javascript change color of a dynamically added row

  12. 12

    How to do calculation in dynamically added row

  13. 13

    option change in Row added dynamically not responding

  14. 14

    Adding onclick function on a dynamically added table row

  15. 15

    Hover effect on dynamically added table row

  16. 16

    knockoutjs hasfocus implementation on dynamically added row

  17. 17

    Row delete does not work

  18. 18

    Laravel Trying to delete MySQL row that was added last

  19. 19

    jQuery Copy dynamically added table row values into next row

  20. 20

    Jquery click does not working with dynamically added link

  21. 21

    To delete a row dynamically from a table using javascript

  22. 22

    How to delete dynamically added item from sortable list?

  23. 23

    unable to delete dynamically added form fields using angular js

  24. 24

    JPA does not delete database row

  25. 25

    JPA does not delete database row

  26. 26

    Removing dynamically added row from a table using jquery

  27. 27

    How to add row numbers to rows added dynamically to a html table

  28. 28

    Datatables responsive doesn't apply to dynamically added row

  29. 29

    How to count number of rows in a table when table row is added dynamically

HotTag

Archive