Cataclysm Cataclysm - 1 year ago 68
jQuery Question

DataTable Fixed Column with Bootstrap's dropdown

I use DataTable with Fixed Columns extension and styling with Bootstrap. The columns I set up as fixed contain Bootstrap's dropdown elements.
The problem is when I click on the dropdown element, my fixed column show the scroll bars or sometimes

were hidden as

enter image description here

Below is the code for initialization of my dataTable

var oTable = $('table').dataTable( {
bFilter : false,
ordering: false,
sScrollX: "100%",
fixedColumns : {
leftColumns : 0,
rightColumns : 1
pagingType : "full_numbers",
"sDom" : '<"top">rt<"bottom"ifp><"clear">',
} );

Here is the JS Fiddle Link. Has someone experience with this or how can I fix this ? Thanks.

Answer Source

You need to append the dropmenu to body and some css to hide the fixed column overflow.

You can tweak the code as per your need.

Check Working Demo HERE


.DTFC_RightBodyLiner {
  overflow: hidden!important;


$(document).ready(function() {
  var oTable = $('table').dataTable({
    bFilter: false,
    ordering: false,
    sScrollX: "100%",
    fixedColumns: {
      leftColumns: 0,
      rightColumns: 1
    pagingType: "full_numbers",
    "sDom": '<"top">rt<"bottom"ifp><"clear">',

  $('.btn').click(function() {

  function dropmenuPostion() {
    // hold onto the drop down menu                                             
    var dropdownMenu;

    // and when you show it, move it to the body                                     
    $(window).on('', function(e) {

      // grab the menu        
      dropdownMenu = $('.dropdown-menu');

      // detach it and append it to the body

      // grab the new offset position
      var eOffset = $(;

      // make sure to place it where it would normally go (this could be improved)
        'display': 'block',
        'top': + $(,
        'left': eOffset.left - 50

    // and when you hide it, reattach the drop down, and hide it normally                                                   
    $(window).on('', function(e) {

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download