Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82269

Bug with FixedHeader Plugin (with possible solution inside)

$
0
0
The plugin is appending itself to the body element, rather than the tables parent element so if in your application you clear a main-content area to load data via ajax or something then the FixedHeader DOM elements are not removed. The FixedHeader remains on other pages this way. Hopefully that makes sense.

I propose making the following change to the FixedHeader plugin: add a new option called "sParentNode" which defaults to the body to maintain backwards compatibility. If this is set to something else, '#main-content' for instance, then the plugin will append itself to that element instead. This is a very minor change to the _fnCloneTable method (starting at about line 325):

        if(s.sParentNode != 'body'){
            $(s.sParentNode).appendChild(nDiv);
        }
        else{
            document.body.appendChild(nDiv)
        }

Viewing all articles
Browse latest Browse all 82269

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>