fnDeleteRow deletes wrong row when applied to rows added programatically..
fnDeleteRow deletes wrong row when applied to rows added programatically..
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());
}
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());
}
This discussion has been closed.
Replies
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