1

我有一个表,我正在使用两个 JQuery 插件:
固定表头: http: //www.mustafaozcan.net/en/page/jQuery-Fixed-Table-Header-Plugin.aspx
列管理器:http://p .sohei.org/jquery-plugins/columnmanager/

这些都与最初在 document.ready 事件处理程序中运行的固定表头一起运行良好。但是,我有一个隐藏/显示表格列的复选框。因为固定表头插件的工作原理是在运行时对表头进行“截图”,因此需要再次运行以考虑此表头更改。问题是每次运行时,它似乎并没有替换函数中已经使用的数据,而是添加更多数据,导致内存泄漏。我已经尝试了各种方法来阻止这种情况的发生,包括:

delete header

$('document').unbind('document.ready', 'table.fixedtableheader')

$('table.fixedtableheader').replaceWith(null)

$('table.fixedtableheader').empty().remove()

header.replaceWith($('table').fixedtableheader({headerrowsize:3}))

$('table').fixedtableheader = null

所有这些(除了使用replaceWith的)都试图删除函数使用的内存,然后我再次运行它。这发生在 chrome、firefox 和大概 IE 中。还有其他人有其他建议吗?

4

0 回答 0