panel
panel copied to clipboard
Tabulator resets view if no results in header filter
This is related to discourse topic (where it is described more in detail) tried with latest panel version 0.13.1rc3 Tabulator widget
Description of expected behavior and the observed behavior
If header filter is applied to Tabulator and no value found (also during input ) and a column is far to the right and has to be scrolled to, the view is reset to the first column. Expected behaviour: Keep the view to the current filtered column.
Complete, minimal, self-contained example code that reproduces the issue
Scroll for example to the right to column “K” and put in a number (view is reset to column A and it would be nice if the view stays at column K):
import pandas as pd
import numpy as np
import panel as pn
pn.extension('tabulator')
df = pd.DataFrame(np.random.randint(500,1000,size=(50, 11)), columns=list('ABCDEFGHIJK'))
filter_editors_numbers = {number_column: {'type':'number','func':'<=','placeholder':'Max value'}for number_column in df.select_dtypes(include=["int"]).columns.to_list()}
tabulator_table = pn.widgets.Tabulator(df, header_filters=filter_editors_numbers,page_size=10,sizing_mode="stretch_width",pagination="local",frozen_columns=["index"])
pn.Column(
tabulator_table,width=250
)
I've reproduced this bug, it only happens when pagination
is set to either local
or remote
.