Editor sDOM
Editor sDOM
I'm trying to work out how I should manipulate the sDOM to have both page pagination and edit buttons on the same page but I'm not able to work it out. I found the exactly same question here but it doesn't seems to be working.
I haven't found anywhere that the capital T stands for in the sDOM, after reading the sDOM documentation I have tried to build the correct sDOM, this is what I was trying:
"sDom": '<"dt-buttons btn-group">frtlip',
Everything works as expected, except the Edit/New/etc buttons are not visible. Removing the sDom line shows the buttons but does not show the page pagination.
Here is the full table initialization:
var curr_table=$('#example').DataTable({
paging: true,
info:false,
"bFilter": true,
"sDom": '<"dt-buttons btn-group">frtlip',
ajax: "jobs_data.php",
"bPaginate": true,
"iDisplayLength": 200,
"aLengthMenu": [[25, 50, 100, 200, 500, 1000, -1], [25, 50, 100,200,500,1000, "All"]],
scrollY: $(document).height()-210,
dom: 'Bfrtip',
columns: [
{ data: "company.Name"},
{ data: "stores.short_add"},
{ data: "job_descriptions.short_description"},
{ data: "jobs.startdate"},
{ data: "jobs.freq"},
{ data: null,
render: function ( data, type, row ) {
if (data.jobs.freq_type == "0")
return "Interval";
else if (data.jobs.freq_type == "1")
return "Set Date";
else
return "One Off/Add-hoc";
}
},
{ data: "clients.Company_Name"},
{data: "operatives.name"}
],
select: true,
buttons: [
{ extend: "edit", editor: editor }, 'copy', 'csv', 'excel', { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A4'}, 'print'
]
});
This question has an accepted answers - jump to answer
Answers
Ignore question, I'm a total idiot!
I have sDom and Dom defined as well....
Good to hear you have it working now!
For reference:
T
was the old TableTools extension, which has now been relegated to the mists of time, in favour of Buttons (B
). You can safely ignore theT
option!Allan