# Tabulator resets view if no results in header filter

**URL:** <https://discourse.holoviz.org/t/tabulator-resets-view-if-no-results-in-header-filter/3735>\
**Category:** Panel\
**Tags:** tabulator\
**Created:** [May 24, 2022, 8:10am UTC](https://discourse.holoviz.org/t/tabulator-resets-view-if-no-results-in-header-filter/3735 "2022-05-24T08:10:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingebert](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ingebert/32/1724_2.png) [@ingebert](https://discourse.holoviz.org/u/ingebert)\
**Post date:** [May 24, 2022, 8:10am UTC](https://discourse.holoviz.org/t/tabulator-resets-view-if-no-results-in-header-filter/3735/1 "2022-05-24T08:10:53Z")

</div>

Hello,

I find the header filter of Tabulator widget very useful.  
Unfortunately if I want to filter a max value (or string) of a column that is very much to the right and I have to scroll to, and this value is a high number, for example 1000, during input the search string is updated and if I enter the 1 and there is no value below 1 in the table, then the Tabulator view is updated and moreover the view is reset to the first column. So I have to scroll to the column again an sometimes it is hard to find. Maybe this is a wanted behaviour, but me and other users that use my app would expect a behaviour, that in any case, if I input something in the header filter then the view stays at this column.  
I updated to current panel 0.13.1rc3.

Here a minimal reproducible example, I hope it is clearer what my “problem” is 🙂 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):

```auto
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
)

```

---

<div class="post-metadata">

**Author:** ![maximlt](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/maximlt/32/2487_2.png) [@maximlt](https://discourse.holoviz.org/u/maximlt)\
**Post date:** [May 24, 2022, 9:10am UTC](https://discourse.holoviz.org/t/tabulator-resets-view-if-no-results-in-header-filter/3735/2 "2022-05-24T09:10:54Z")

</div>

Thanks for the example! And I agree. Could you open an issue on Github?

---

<div class="post-metadata">

**Author:** ![ingebert](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ingebert/32/1724_2.png) [@ingebert](https://discourse.holoviz.org/u/ingebert)\
**Post date:** [May 24, 2022, 9:36am UTC](https://discourse.holoviz.org/t/tabulator-resets-view-if-no-results-in-header-filter/3735/3 "2022-05-24T09:36:31Z")

</div>

Sounds good, thanks.  
I opened an issue:

> <https://github.com/holoviz/panel/issues/3553>
>
> This is related to \[discourse topic\](https://discourse.holoviz.org/t/tabulator-r…esets-view-if-no-results-in-header-filter/3735) (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
> )
