简体   繁体   English

带有 DataTables(jQuery 插件)的表中的外部链接

[英]external link in a table with DataTables (a plug-in for jQuery)

I have a table here which is built using a JSON file and DataTables (a plug-in for the jQuery Javascript library).这里有一个表,它是使用 JSON 文件和数据表(jQuery Javascript 库的插件)构建的。 The table can be filtered and the plug-in works.表格可以过滤,插件可以工作。

The cells in the first column contain a link to an external website, which opens in a different tab (I used target="_blank" ).第一列中的单元格包含指向外部网站的链接,该网站在不同的选项卡中打开(我使用了target="_blank" )。 When I apply filter to the table, its rows are filtered correctly but as I click on a link all filters are reset and the entire table is shown .当我对表格应用过滤器时,它的行被正确过滤,但是当我点击一个链接时,所有过滤器都被重置并且显示整个表格

Any tips to work around this?解决此问题的任何提示?

It turned out to be a small bug in the previous repository of DataTables.原来是之前DataTables仓库的一个小bug。 Following this discussion , I solved the issue by using the latest release of the pug-in.讨论之后,我使用最新版本的插件解决了这个问题。 Now the links in the first column do not cause the entire table to redraw.现在第一列中的链接不会导致整个表格重绘。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM