Fixed header/footer not working.

Fixed header/footer not working.

klsdngrklsdngr Posts: 2Questions: 2Answers: 0

This function gets called after gridview gets populated.

function BindDataTable(targetGrid) {
        var sortableGrid = $(targetGrid).attr('id');
        var DT = $('#' + sortableGrid).dataTable({
            "fnInitComplete": function () {
                $('#' + sortableGrid + ' thead > tr').removeClass().addClass("HeaderGridView2").css('cursor', 'pointer');
                $('#' + sortableGrid + ' tfoot > tr').removeClass().addClass("FooterGridView2");
            },
            "bPaginate": false,
            "bLengthChange": false,
            "bFilter": false,
            "bSort": true,
            "bInfo": false,
            "bAutoWidth": false,
            "asStripClasses": null, //To remove "odd"/"event" zebra classes
            "fnDrawCallback": function () {
                $('#' + sortableGrid + ' tr').removeClass();
                $('#' + sortableGrid + ' tr:even').addClass("RowGridView2 even");
                $('#' + sortableGrid + ' tr:odd').addClass("AlternatingRowGridView2 odd");
                $('#' + sortableGrid + ' thead > tr').removeClass().addClass("HeaderGridView2").css('cursor', 'pointer');
                $('#' + sortableGrid + ' tfoot > tr').removeClass().addClass("FooterGridView2");
            },
            fixedHeader: {
                header: true,
                footer: true
            }
        });
    }

I have added below js files:

<script src="../Js/DataTables/media/js/jquery.js"></script>
<script src="../Js/DataTables/media/js/jquery.dataTables.js"></script>
<script src="../Js/DataTables/media/js/fixedHeader.js"></script>

But it does not keeps header/footer fixed.

This discussion has been closed.