How to remove an element from table? Fix problem!!!
How to remove an element from table? Fix problem!!!
gilbertoalbino
Posts: 2Questions: 0Answers: 0
Hi there, this is my first post on DataTables forum.
I am running accross a situation:
I've created a user list and added the actions for update and delete in the very right of the table in a column called 'Actions';
somewhat like this:
[ username ] [ user_email ] [ actions ]
[ John Doe ] [john@doe.com ] [ Edit - Remove ]
The in the click action for 'Remove' I've set this code:
[code]
jQuery('.delete').click(
function() {
var id = jQuery( this ).parent().attr( 'id');
$( '#' + id ).parent().remove();
jQuery.ajax({
url : '/admin/ajax/user/delete/id/' + id,
type : 'GET'
});
}
);
[/code]
This code does exactly what it is supposed to do BUT when I paginate the table and get back to the same page where it was before, it is listed again as if the table had built all the list all over again.
Any clue of how to remove definitely from DataTable?
I am running accross a situation:
I've created a user list and added the actions for update and delete in the very right of the table in a column called 'Actions';
somewhat like this:
[ username ] [ user_email ] [ actions ]
[ John Doe ] [john@doe.com ] [ Edit - Remove ]
The in the click action for 'Remove' I've set this code:
[code]
jQuery('.delete').click(
function() {
var id = jQuery( this ).parent().attr( 'id');
$( '#' + id ).parent().remove();
jQuery.ajax({
url : '/admin/ajax/user/delete/id/' + id,
type : 'GET'
});
}
);
[/code]
This code does exactly what it is supposed to do BUT when I paginate the table and get back to the same page where it was before, it is listed again as if the table had built all the list all over again.
Any clue of how to remove definitely from DataTable?
This discussion has been closed.
Replies