I am using the JQuery DataTables plugin for displaying large sets of data. One thing I am trying to do is shorten the ‘details’ column (sometimes they are around 1000 characters) to a small string so that the rows are all fairly the same height and easier to read. Then when a user clicks on the small string, it opens a dialog and displays the full details.
It works great, but only on the first 10 rows (since those are all that is shown by default). Once I expand the table to display the rest of the rows, the function doesnt seem to be applied to those newly shown rows. Is there a call or option in dataTables that will apply the function everytime the row set being shown is changed?
Here is the dataTables call:
$('#dataTable').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"fnInitComplete": function(){
$('.display_results').show();
$('.def').click(function(){
var msg = $(this).next().text();
$('.messages').messageBox();//Custom Dialog box call
});
}
});
Figured it out!
http://datatables.net/usage/callbacks
use ‘fnDrawCallback’