TD scroll not working on table with server side processing?
TD scroll not working on table with server side processing?
I have my report site setup with Scrollx: true
. I also have a Dev site that is using server side processing as well as the Scrollx: true
.
Since the Prod site is not using server side processing yet when the data for a <td>
over flows there is a scroll bar added so that you can see it all and it doesn't overflow onto the rest of the <td>
's to the right of it.
With the Dev site, which is using server side processing the scroll bar does not show up. When there is too much data for the <td>
it overflows into the <td>
's to the right.
How can I fix this so that even with server side processing I have the scrolling?
Prod
$(document).ready(function() {
$('#DataTable').DataTable(
{
"lengthMenu": [[25,50,75,100,150],[25,50,75,100,150]],
"ScrollX": true,
"dom": '<"top"iflp<"clear">>rt<"bottom"ip<"clear">>',
"fixedHeader": { header: true, footer: false }
});
});
Dev
$(document).ready(function ()
{
$('#DataTable').DataTable(
{
"lengthMenu": [[25, 50, 75, 100, 150], [25, 50, 75, 100, 150]],
"ScrollX": true,
"dom": '<"top"Biflp<"clear">>rt<"bottom"ip<"clear">>',
"buttons": [
{ extend: 'collection', text: 'Selection', buttons: ['selectAll', 'selectNone'] },
{ extend: 'collection', text: 'Export', buttons: ['excel', 'csv', 'pdf']}],
"fixedHeader": { header: true, footer: false },
"select": true,
"processing": true,
"serverSide": true,
"ajax": { "url": "ServerSide.php?PageName=<?php echo $Page; ?>", "dataType": "json" }
});
});
Answers
Never mind I got this working by editing my modified version of the ssp.class.php file so that the data_output function now looks like this:
I had to add a div inside the individual td so that the scroll would work.