Responsive not working on my Drupal 8 Views table :-(

Responsive not working on my Drupal 8 Views table :-(

gbmapogbmapo Posts: 17Questions: 6Answers: 0

I try to use Responsive extension and it doesn't work!
As you can see in the screen capture, DataTables is working: the minimalist initilaisation code:

jQuery(document).ready(function ($) {
  $('#listofservices').DataTable({
    responsive: true,
  });
});

gives the default behavior for ordering, paging and info.

But nothing about Responsive!
When I reduce the width of my browser window, at a certain point, last column overflow the size of the container.

What am I missing?

My configuration:
* DataTables-1.10.18
* FixedHeader-3.1.4
* Responsive-2.2.3

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,171Questions: 26Answers: 4,922

    Do you have style="width:100%" configured on your table tag?

    The problem will be with the HTML environment. If style="width:100%" doesn't help then please post a link to your page or a test case replicating the issue so we can take a look.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • gbmapogbmapo Posts: 17Questions: 6Answers: 0

    I hadn't style="width:100%" but adding it didn't help.
    You can have a look at the page here lejardindepoissy.org/sel/services.
    Since my first post, I added

        "ordering": false,
        "paging": false,
        "info": false,
    

    to my code...

  • kthorngrenkthorngren Posts: 21,171Questions: 26Answers: 4,922
    Answer ✓

    I might be missing it but I don't see where you are including the Responsive Extension. I see you have combined DT and FixedHeader in datatables.js but it doesn't include responsive.js:

     * This combined file was created by the DataTables downloader builder:
     *   https://datatables.net/download
     *
     * To rebuild or modify this file with the latest versions of the included
     * software please visit:
     *   https://datatables.net/download/#dt/dt-1.10.18/fh-3.1.4
     *
     * Included libraries:
     *   DataTables 1.10.18, FixedHeader 3.1.4
    

    Kevin

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    I don't see where you are referencing DT's Responsive js extension.

  • gbmapogbmapo Posts: 17Questions: 6Answers: 0

    My mistake!
    According to what you said, I just dowloaded the whole thing again and now it works:

    Thanks a lot.

This discussion has been closed.