I've a button in a form and when is pressed, display a modal window that contains a jQuery DataTable and I can search, navigate or paginate and show 10 or 20 entries but when I press any TR to get information of each TD in that TR and put this information in a 3 elements in the form and close modal window... is OK, but if I press the button again to open the modal window with datatables, search functions, show more entries or paginate no longer work
Create a DataTable
$('#tableResults').dataTable({
"sPaginationType" : "full_numbers"
});
Execute modal window
$('#button').click(function() {
$("#divModal").modal({onClose: function (dialog) {
dialog.container.fadeOut('slow', function () {
$.modal.close();
});
}});
});
Event click TR
$('#tableResults tr:gt(0)').live('click', function() {
name = $(this).closest('tr').find('td:eq(0)').text();
lastname = $(this).closest('tr').find('td:eq(1)').text();
email = $(this).closest('tr').find('td:eq(2)').text();
$('#name').text("Name: "+name);
$('#lastname').text("Last Name: "+lastname);
$('#email').text("Email: "+email);
$.modal.close();
});
I hope I explained and thanks in advance.