简体   繁体   English

制表符:切换列时顶部和按钮计算不会移动位置。 如何在不丢失滚动位置的情况下切换列和刷新表?

[英]Tabulator: Top and button calc not shifting position when a column is toggled. How to toggle column and refresh table without losing scroll position?

My goal is to be able to toggle the visibity of toggles and keep the same formatting.我的目标是能够切换开关的可见性并保持相同的格式。 Currently my solution to use a filter does this but loses the current scroll position of the tabulator.目前,我使用过滤器的解决方案会执行此操作,但会丢失制表符的当前滚动位置。 This is unaccepatable.这是不可接受的。

$("#toggleNotes").change(function () {
    // Toggles the visibility of the Notes column.
    $("#allocations-table").tabulator("toggleColumn", "Notes");
    $("#allocations-table").tabulator("setFilter", "AllocationId", ">", -1);
});

Not using the filter results in the top and bottom calc not shifting to accomadate the new column.不使用过滤器会导致顶部和底部计算不会移动以适应新列。 Is it possible to shift the top and bottom calc?是否可以移动顶部和底部计算? Is there a way to recalculate column top and bottom calc without reseting the table each time?有没有办法重新计算列顶部和底部计算而无需每次都重置表格?

I am using tabulator 3.5 and I am unable to upgrade to the latest version.我使用的是 tabulator 3.5,但无法升级到最新版本。

PS: Thanks for making the tabulator free. PS:感谢您免费提供制表器。

Even performance changed on v4.9 but some problems remain or produced.The bottom/top calc have problem even on version 4.9 when it comes to horizontal scroll.即使在 v4.9 上性能发生了变化,但仍然存在或产生了一些问题。在水平滚动方面,即使在 4.9 版上, bottom/top calc也有问题。 Also there is problems with RTL languages . RTL languages也存在问题。 I have attached a sample image of sample table generated with Tabulator 4.9 .我附上了用Tabulator 4.9生成的示例表的示例图像。 For Example if we active Frozen Column and same time set direction to RTL, the frozen row floating to the left while it should be fixed on the right side of table.例如,如果我们激活 Frozen Column 并同时将方向设置为 RTL,则冻结行向左浮动,而应固定在表的右侧。 I have fixed soring carret position on my custom css easily,but others are remained yet.我已经很容易地在我的自定义 css 上固定了刺痛的 carret 位置,但其他人还没有。 在此处输入图片说明

These are only some problems on first hours of working with Tabulator new version.这些只是使用 Tabulator 新版本的第一个小时的一些问题。 官网的另一个例子

It's a bug in Tabulator.这是 Tabulator 中的一个错误。 If you scroll, it causes a redraw which moves the bottom or top calc row to the correct position.如果滚动,它会导致重绘,将底部或顶部 calc 行移动到正确的位置。 You can force it by shifting the scroll position.您可以通过移动滚动位置来强制它。

cell.getElement().closest('.tabulator-tableHolder').scrollLeft += 1;

You will need to upgrade to a newer version of Tabulator to overcome those limitations.您需要升级到较新版本的 Tabulator 才能克服这些限制。 version 4.6 is the current version版本 4.6 是当前版本

Tabulator 4 does come with a jQuery Wrapper so you can continue using it just as before. Tabulator 4 确实带有一个jQuery Wrapper,因此您可以像以前一样继续使用它。 and the docs have a step by step Upgrade Guide to take you through making the changes.并且文档有分步升级指南,可引导您完成更改。

I have upgraded sites with hundreds of tables and it has taken between a few minutes and a few hours depending on complexity of the tables我已经升级了数百张桌子的网站,根据桌子的复杂程度,它需要几分钟到几个小时

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

相关问题 如何刷新代码而不丢失滚动位置? - How to refresh code without losing scroll position? 切换按钮时保留滚动位置 - Retain scroll position when a button is toggled 如何固定列位置<table>什么时候<input>在<td>在一个<tr>行被切换为隐藏/显示无/块 - how to fix column position in <table> when <input> in <td> in a <tr> row are being toggled to hide/display with none/block 制表器:调整表格列宽时修复最右侧列的 position - Tabulator: Fix position of right most column when adjusting table column width 如何将滑动切换按钮添加到制表符列中的每个单元格 - How to add a slide toggle button to every cell in tabulator column 当滚动位置到达顶部位置时如何点击功能? - How to hit a function when scroll position is reaches the top position? 如何在Bootstrap表中的输入文件旁边的列中定位按钮 - How to position button within column next to input file in Bootstrap table addEventListener(“scroll”) 加载时如何不调度且初始滚动 position 不在顶部 - How not to dispatch addEventListener(“scroll”) when it is loaded and the initial scroll position is not at the top 如何将表格单元格 position 计算为数组? - How to calc table cell position to array? 固定在滚动位置上的图像 - Fixed Image On Scroll Shifting Position
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM