Header is not moving along with vertical scroll

Header is not moving along with vertical scroll

pratsprats Posts: 45Questions: 21Answers: 0

I have added https://cdn.datatables.net/v/dt/jszip-2.5.0/pdfmake-0.1.18/dt-1.10.13/b-1.2.4/b-colvis-1.2.4/b-flash-1.2.4/b-html5-1.2.4/b-print-1.2.4/cr-1.3.2/sc-1.4.2/se-1.2.0/datatables.min.js
in my html page,for scroller feature if i add more columns it overlaps other content of window page or just table body moves without moving header.
As mentioned in other posts i have not included FixedHeader in html/js/css files
I am not able to add test page as I am receiving data from web service,so here is my code...
`<html>
<head>

<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/js/datatable/select2.full.js"></script>
    <script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/js/datatable/jquery.dataTables.yadcf.js"></script>
    <link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/js/datatable/datatables.min.css" />

<link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/js/datatable/select2.min.css" />
    <h2 style="color:#2196F3;">Ticket Data</h2>

```

</head>
<body>
 <table id="ex1" class="display cell-border" cellspacing="0" width="100%">
</table>
<script>
$(document).ready(function() {
     var realPath =$(&quot;#root&quot;)&#46;val();
        var webServicePathm = realPath+&quot;/mt/saasreporting/getopenticketsdata?&quot;;
        //var project = projectname.innerText;
        var parmUrl = &quot;project=test project&quot;;
        var webCallUrl = webServicePathm+parmUrl;

      var Table= $(&#39;#ex1&#39;).DataTable( {
        
        
          rowReorder: true,
            colReorder: true,
            
 &quot;ajax&quot;: {
   &quot;url&quot;:webCallUrl,
   &quot;dataSrc&quot;: function ( json ) {
       for ( var i=0, ien=json.length ; i&lt;ien ; i++ ) {
           json[i][0] = &#39;&lt;a href=&quot;/message/&#39;+json[i][0]+&#39;&gt;View message&lt;/a&gt;&#39;;
         }
         return json;
       }
 },
 &quot;columns&quot;: [
             { &quot;data&quot;: &quot;client&quot;, &quot;name&quot;: &quot;client&quot;, &quot;title&quot;: &quot;client&quot; },
             { &quot;data&quot;: &quot;project&quot;, &quot;name&quot;: &quot;project&quot;, &quot;title&quot;: &quot;project&quot; },
             { &quot;data&quot;: &quot;raisedOn&quot;, &quot;name&quot;: &quot;raisedOn&quot;, &quot;title&quot;: &quot;raisedOn&quot; },
             { &quot;data&quot;: &quot;ticketId&quot;, &quot;name&quot;: &quot;ticketId&quot;, &quot;title&quot;: &quot;ticketId&quot; },
             { &quot;data&quot;: &quot;assignedTo&quot;, &quot;name&quot;: &quot;assignedTo&quot;, &quot;title&quot;: &quot;assignedTo&quot; },
             { &quot;data&quot;: &quot;priority&quot;, &quot;name&quot;: &quot;priority&quot;, &quot;title&quot;: &quot;priority&quot; } 
             
   
            
         ],
         &quot;pagingType&quot;:&quot;full_numbers&quot;,
         select: true,
              
&quot;sDom&quot;: &#39;B&lt;&quot;clear&quot;&gt;Wfrtip&#39;,
lengthMenu: [
[ 10, 12, 50, -1 ],
[ &#39;10 rows&#39;, &#39;12 rows&#39;, &#39;50 rows&#39;, &#39;Show all&#39; ],
],

&quot;buttons&quot;: [
{
    className: &#39;b2&#39;,
extend:&#39;pageLength&#39;,
autoClose: true,
/* text: &#39;&lt;i class=&quot;fa fa-list-ol-3x&quot; aria-hidden=&quot;true&quot; style=&quot;color:#81ad30&quot;&gt;&lt;/i&gt;&#39;, */
titleAttr: &#39;no.of rows&#39;

},
{
    className: &#39;b2&#39;,
extend: &#39;colvis&#39;,
  autoClose: true,
 /*   text: &#39;&lt;i class=&quot;fa fa-columns-3x&quot; aria-hidden=&quot;true&quot; style=&quot;color:#81ad30&quot;&gt;&lt;/i&gt;&#39;, */
  titleAttr: &#39;Column Visibility&#39;,
  exportOptions: {
      columns: &#39;:visible&#39;,
  }
}
],

ScrollY:        true,
deferRender:    true,
scrollCollapse: true,
ScrollX: 300

  
        });
        
      new $.fn.dataTable.Buttons( Table, {
          buttons: [
              {
                  className: &#39;b1&#39;,
                                                extend:    &#39;copyHtml5&#39;,
                                                            /* text:      &#39;&lt;i class=&quot;fa fa-files-o&quot; style=&quot;color:green&quot;&gt;&lt;/i&gt;&#39;, */
                                   titleAttr: &#39;Copy&#39;,
                                            exportOptions: {
                                                    modifier: {
                                                        page: &#39;current&#39;
                                                    }
                                          }

                               },{
                                 className: &#39;b1&#39;,
                                            extend:    &#39;excelHtml5&#39;,
                                                           /*  text:      &#39;&lt;i class=&quot;fa fa-file-excel-o&quot; style=&quot;color:green&quot;&gt;&lt;/i&gt;&#39;, */
                                   titleAttr: &#39;Excel&#39;,
                                            exportOptions: {
                                                columns: &#39;:visible&#39;,
                                                modifier: {
                                                        page: &#39;current&#39;
                                                              }
                                            }
                               },{
                                 className: &#39;b1&#39;,
                                            extend:    &#39;csvHtml5&#39;,
                                                            /* text:      &#39;&lt;i class=&quot;fa fa-file-word-o&quot; style=&quot;color:green&quot;&gt;&lt;/i&gt;&#39;, */
                                titleAttr: &#39;CSV&#39;,
                                            exportOptions: {
                                            columns: &#39;:visible&#39;,
                                                modifier: {
                                                        page: &#39;current&#39;
                                                          }
                                            }

                               },
                {
                                 className: &#39;b1&#39;,
                                 extend:    &#39;pdfHtml5&#39;,
                                 message:&#39;Tickets Status&#39;,
                                           /*  text:      &#39;&lt;i class=&quot;fa fa-file-pdf-o&quot; style=&quot;color:red&quot;&gt;&lt;/i&gt;&#39;, */
                                   titleAttr: &#39;PDF&#39;,
                                   footer: true,
                                            exportOptions: {
                                                columns: &#39;:visible&#39;,

                                                 modifier: {
                                                                    page: &#39;current&#39;
                                   }
                          }
                               },
                 {
                        className: &#39;b1&#39;,
                        extend: &#39;print&#39;,
                        /* text: &#39;&lt;i class=&quot;fa fa-print&quot; aria-hidden=&quot;true&quot; style=&quot;color:blue&quot;&gt;&lt;/i&gt;&#39;, */
                        titleAttr: &#39;Print&#39;,
                        footer: true,
                        autoPrint: true,
                        exportOptions: {
                        columns: &#39;:visible&#39;,
                        modifier: {
                        page: &#39;current&#39;
                        }
                    }
                }
          ]
      } );

      Table.buttons( 1, null ).container().appendTo(
              Table.table().container()
);
                
      yadcf.init(Table, [
                            {
                column_number : 0,
                filter_type: "multi_select",
                select_type: 'select2',
                column_data_type: "text",
                html_data_type: "text",
                filter_default_label: "clients"                 
                            },
                            {
                column_number : 1,
                filter_type: "multi_select",
                select_type: 'select2',
                column_data_type: "text",
                html_data_type: "text",
                filter_default_label: "projects"
                            },
                            {
                column_number : 2,
                filter_type: "multi_select",
                select_type: 'select2',
                column_data_type: "text",
                html_data_type: "text",
                filter_default_label: "raisedOn"
                            },
                            {
                column_number : 3,
                filter_type: "multi_select",
                select_type: 'select2',
                column_data_Type: "text",
                html_data_type: "text",
                filter_default_label: "ticketId"
                            }, 
                            {
                column_number : 4,
                filter_type: "multi_select",
                select_type: 'select2',
                column_data_type: "text",
                html_data_type: "text",
                filter_default_label: "assignedTo"
                            } ,
                            {
                                column_number : 5,
                                filter_type: "multi_select",
                                select_type: 'select2',
                                column_data_type: "text",
                                html_data_type: "text",
                                filter_default_label: "tag"

                            } 
                  
                   ]); 
      
      $('#search').on( 'click', function () {
          Table.search( this.value ).draw();
        } );
    });
  
    </script>

</body>
</html>

`

This discussion has been closed.