panel icon indicating copy to clipboard operation
panel copied to clipboard

Tabulator resets view if no results in header filter

Open ingebert opened this issue 2 years ago • 1 comments

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
)


ingebert avatar May 24 '22 09:05 ingebert

I've reproduced this bug, it only happens when pagination is set to either local or remote.

maximlt avatar Jul 04 '22 12:07 maximlt