Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81910

Prevent DataTable from collapsing Columns?

$
0
0

I set my dataTable to scroll:

$('#data-table').DataTable({
    destroy: true,
    aaData: res.data,
    aoColumns: [
        { "sTitle": "Order ID", "mData": "OrderID", "sClass": "left" },
        { "sTitle": "Order Date", "mData": "OrderDate", "sClass": "left" },
        { "sTitle": "First Name", "mData": "FirstName", "sClass": "left" },
        { "sTitle": "Last Name", "mData": "LastName", "sClass": "left" },
        { "sTitle": "Patient ID", "mData": "LicenseNumber", "sClass": "left" },
        { "sTitle": "Quantity", "mData": "Quantity", "sClass": "right" },
        { "sTitle": "Total Amount", "mData": "TotalAmount", "sClass": "right" },
        { "sTitle": "Application Type", "mData": "PersonType", "sClass": "left" },
        { "sTitle": "Expiration Date", "mData": "ExpiryUtc", "sClass": "right" },
        { "sTitle": "Reason", "mData": "Reason", "sClass": "left" },
    ],
    scrollX: true,   //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    scrollY: 300,   //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    scrollCollapse: true,
    responsive: true,
    colReorder: false,
    keys: true,
    select: true
});

But often if the initial view is too narrow, instead of presenting the data with a horizontal scroll bar. instead the data is shown with the first column have the detail "+" button and one or more columns are hidden. How can I force the dataTable NEVER to collapse data columns into the detail "+" section?

Also something is often hiding the horizontal scroll bar. If I have the dataTable showing with the horizontal scrollbar and no columns collapse, then manually resize the browser, often the H scrollbar disappears and then never comes back except WHILE resizing I will see a brief flash of the H scrollbar. Do you know what css draws the H scrollbar and how to force it to always show when present?"

P,S, - please update this forum to allow pasting of images directly into the post like you can do on Stack Overflow, or at least allow files and images to be uploaded from local storage, don't make us have to find some hosting service to upload our files and images to. Your "Attach image/file" button is grossly misnamed as it dosn't allow you to attach anything, instead it mearly is another name for an url link to another hosting service.


Viewing all articles
Browse latest Browse all 81910

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>