Search code examples
htmlcsstwitter-bootstrapbootstrap-table

Bootstrap-Table Extension - Dropdown in Row Pops Under Table Container


I am using a bootstrap dropdown in each row of a table that uses the bootstrap-table extension written by wenzhixin. The dropdown itself works fine, however, when I open a dropdown near the bottom of the table it shows the vertical scrollbar and the options pop under the containing div for the table. I've been playing with the CSS for a while with no joy.

Has anyone ran into this issue and found a solution?

screen shot


Solution

  • This may be slightly "hackish" but it's straightforward and simple. The extension creates the table with a fixed-table-body class. Once that's removed it renders without constraining bootstrap dropdowns.

    $('#table').bootstrapTable({
        onPostBody: function(data) {
            $('#table')
                .find('.fixed-table-body')
                .removeClass('fixed-table-body');
        }
    });