多个数据表和引导选项卡的响应问题 [英] Responsive Issues With Multiple DataTables And Bootstrap Tabs
问题描述
我创建了一个模拟我正在编码和显示的例子我遇到的行为可以在这里找到: http://live.datatables.net/sozobucu/edit
响应式插件无法确定隐藏表的列要求。因此,在显示表格(标签已更改)后,需要调用以下重新计算列:
$($。fn .dataTable.tables(true))。DataTable()。columns.adjust()。respond.recalc();
这些调用在DataTable 10.7中无法正常工作,但在最近的夜间构建中已修复。在短期内,我们将使用夜间版本,直到此修复程序正式发布。希望这有助于有人遇到同样的问题。
讨论可以按照 here 。
I have 2 bootstrap wells and each well contains a pair of tabs. Each tab contains a DataTable (there are 4 in total). When I load the page the first two DataTables work perfectly as expected. When I switch tabs the tables that are rendered always include 1 column (regardless to the column size) and the remainder are part of the child row. I've tried just about everything to get the table to draw correctly. If anyone has any suggestions please let me know. Also I'm somewhat new to web UI code so if there are any glaring mistakes please bear with me.
I have created an example that mimics what I am coding and shows the behavior I'm experiencing. It can be found here: http://live.datatables.net/sozobucu/edit
The responsive plugin can't determine the column requirements for tables that are hidden. So after the table is shown (tab changed) the following needs to be called to recalculate the columns:
$($.fn.dataTable.tables(true)).DataTable().columns.adjust().responsive.recalc();
These calls were not functioning correctly in DataTables 10.7 but have been fixed in the most recent nightly build. In the short term we will use the nightly build until this fix makes it into an official release. Hope this helps someone if they experience the same issue.
The discussion can be followed here.
这篇关于多个数据表和引导选项卡的响应问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!