I'm using jQuery DataTables to build a grid, with AJAX loaded data and pagination.
I built a form to create a new record, save it on the database and reload the grid. I would like to selected the last inserted record.
The problem is: the grid only shows 10 records. How would be the logic to calculate in what page the last row will appear to navigate to it?
After your record is added you can refresh the table details like bellow
var oTable = jQuery('#infotable').dataTable({
//your code
});
now after new record added success after ajax just call fnDraw. it will load your newly added record
jQuery.ajax({
type: 'POST',
url: 'your url',
data: yourdata,
success: function(data){
oTable.fnDraw();
}
});