Fixed Header not aplying on DataTable

Fixed Header not aplying on DataTable

HridyaHridya Posts: 2Questions: 1Answers: 0

I have initialized a datatable and trying to initialize fixedHeader on that table. Eventhough i have set fixedheader as true and added reference to fixedheader JS and CSS, it doesn't reflect. Could you please help me here
Please find below the code snippet

$('#profileList').DataTable({
fixedHeader: {
header: true,

    },
    "ajax": {
        "url": APP_PATH + "/Account/GetAllProfiles",
        "dataSrc": "",
        "type": "POST",
    },
    "columns": [
         {
             data: "User_ID", title: "", class: "CenterAlign","bSortable":false, "render": function (data) {
                 var link = '<a href="'+APP_PATH+'Account/Profile?id=' + data + '"><span class="glyphicon glyphicon-pencil"></span></a>';
                 return link;
             }
         },

         { data: "First_Name", title: "First_Name", class: "CenterAlign" },
         { data: "Middle_Name", title: "Middle_Name", class: "CenterAlign" },
         { data: "Last_Name", title: "Last_Name", class: "CenterAlign" },
         { data: "Office_ID", title: "Office_ID", class: "CenterAlign" },
         { data: "Office_Email_ID", title: "Office_Email_ID", class: "CenterAlign" },
         { data: "Mobile_Number", title: "Mobile_Number", class: "CenterAlign" },
         { data: "Project_Start_Date", title: "Project_Start_Date", class: "CenterAlign" },
         { data: "Project_End_Date", title: "Project_End_Date", class: "CenterAlign" },
         { data: "Birthday", title: "Birthday", class: "CenterAlign" },
    ],

    "bAutoWidth": false,
    "bPaginate": false,
    "bLengthChange": false,
    "bInfo": false,
    "bAutoWidth": false,
    "bFilter": false,
    dom: 'Bfrtip',
    buttons: [
        {
            extend: "excel",
            text: '<span class="glyphicon glyphicon-export"></span>&nbsp;Export To Excel',
            orientation: 'landscape',
        }
    ],
    "initComplete": function () {
        enableProfilesInlineEdit('#profileList');
    }
})

Answers

  • HridyaHridya Posts: 2Questions: 1Answers: 0

    Any help on this asap is much appreciated!!

  • reninsomereninsome Posts: 10Questions: 3Answers: 1

    Is your datatable binding working properly ??
    only fixed header is issue or something else ??
    try only

    fixedHeader: true,

This discussion has been closed.