fnDeleteRow deletes wrong row when applied to rows added programatically..

fnDeleteRow deletes wrong row when applied to rows added programatically..

jorgenjorgen Posts: 3Questions: 0Answers: 0
edited April 2013 in General
function addMember() {
var id = $("#newMember").val();
var del = "";
if (id) {
$("#newMember").select2("data", null);
$('#member_tbl').dataTable().fnAddData([
id,
"adad",
"adad",
"adad",
"adad",
del
]);
}
}

function removeMember(element, id) {

memberTable.fnDeleteRow($(element).parent().parent());
}

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Please link to a test case: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read .

    Also note that fnDeleteRow does not table a jQuery object - it takes a node. Add `[0]` to your jQuery object to get the node.

    Allan
This discussion has been closed.