简体   繁体   中英

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.

PS: Thanks for making the tabulator free.

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. Also there is problems with RTL languages . I have attached a sample image of sample table generated with 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. I have fixed soring carret position on my custom css easily,but others are remained yet. 在此处输入图片说明

These are only some problems on first hours of working with Tabulator new version. 官网的另一个例子

It's a bug in Tabulator. If you scroll, it causes a redraw which moves the bottom or top calc row to the correct position. 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. version 4.6 is the current version

Tabulator 4 does come with a jQuery Wrapper so you can continue using it just as before. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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