Issue specifying dom breaking scrollY functionality
Issue specifying dom breaking scrollY functionality
nsscott
Posts: 24Questions: 10Answers: 0
I have a table which has been working great using the scrollY option. I now needed to add an Export button to the table and this seems to break the scrollY functionality. It seems even specifying the "dom" parameter with the single "f" option stops the functionality. Any thoughts?
/*
dom: 'f', //Uncommenting this single line breaks the scrollY
buttons: [
{
extend: 'excel',
text: 'Export',
className: 'btn btn-circle green-sharp btn-md',
exportOptions: {
columns: [1, 2, 3, 4, 5, 6, 7, 8]
}
}
],
*/
scrollY: "200px",
scrollCollapse: true,
paging: false,
rowId: 'Id',
order: [[ 1, "asc" ]],
columns: [
{
data: null,
orderable: false,
searchable: false,
defaultContent: '<a class="btn btn-circle btn-xs green-sharp viewDocument">View</a>'
},
{
name: "Code", data: "Code"
},
{
name: "DocumentTypeName", data: "DocumentTypeName"
},
{
name: "FactoryCode", data: "FactoryCode"
},
{
name: "Status", data: "Status"
},
{
name: "Uploaded", data: "Uploaded"
},
{
name: "ValidFrom", data: "ValidFrom"
},
{
name: "ValidTo", data: "ValidTo"
},
{
name: "AssetNames", data: "AssetNames"
}
]
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You are specifying to only show the Datatables filter input. You need to add
t
to have Datatables display the table. Then scrollY will work. Here is the dom option docs:https://datatables.net/reference/option/dom
Kevin
Well I feel silly now. Thanks Kevin!
Scott