Can we use FixedHeader functionality with ServerSide option?

Can we use FixedHeader functionality with ServerSide option?

jaisinkjaisink Posts: 3Questions: 1Answers: 0

Hi Guys

We are using SpringBoot Java application with DataTables and also ServerSide set to true. When tried to use the configuration option specified for the FixedHeader, it is completely ignored, no errors either. Any suggestions or any additional setup necessary to trigger the functionality?

Below is the JS code :

    $(document).ready(function() {
        App.init();
        Dashboard.init();

        var matchingRepositoriesTable = $('#matchingRepositories').DataTable({
            ajax: '/subjectrepository/select/datatables/',
            serverSide: true,
            processing: true,
            deferLoading: 0,
            fixedHeader: {
                header: true,
                footer: true
            },
            order: [ ['12','desc'],['13','desc'] ],
            drawCallback: function (data, type, full, meta) {
                $('[data-toggle="tooltip"]').tooltip({ 
                    placement: 'right',
                    title: 'heyo',
                    container: 'body',
                    html: true 
                });
            },
            columns: [
                {
                    data: 'createDate',
                    searchable:false,
                    sortable:false,
                    orderable:false,
                    width: '5%',

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
    Answer ✓

    Have you loaded the FixedHeader library files (js/css)?

    It works in this example with server side processing:
    http://live.datatables.net/rijopuvu/1/edit

    Kevin

  • jaisinkjaisink Posts: 3Questions: 1Answers: 0

    Many Thanks :) Kevin for providing an example and confirming the server side processing.

    Only change was that I had to download the latest set of js/css and it worked all fine.

  • jaisinkjaisink Posts: 3Questions: 1Answers: 0

    Hi Kevin
    It worked well on the first screen but on the second when tried to implement the same functionality the fixed header is not aligned with the table header. Fixed header is starting without the left margin. Any suggestion or fix? Thanks in advance.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

Sign In or Register to comment.