Bug with FixedHeader Plugin (with possible solution inside)
Bug with FixedHeader Plugin (with possible solution inside)

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):
[code]
if(s.sParentNode != 'body'){
$(s.sParentNode).appendChild(nDiv);
}
else{
document.body.appendChild(nDiv)
}
[/code]
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):
[code]
if(s.sParentNode != 'body'){
$(s.sParentNode).appendChild(nDiv);
}
else{
document.body.appendChild(nDiv)
}
[/code]
This discussion has been closed.