Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Native filter does not work with pagination after page 0 #782

Closed
shieldofchaos opened this issue May 23, 2020 · 2 comments · Fixed by #907
Closed

Native filter does not work with pagination after page 0 #782

shieldofchaos opened this issue May 23, 2020 · 2 comments · Fixed by #907

Comments

@shieldofchaos
Copy link

shieldofchaos commented May 23, 2020

Greetings. It seems like there is a bug with native filtering when it is used on the datatable with pagination after page 1. The datatable documentation version works but it could be due to custom filtering?

Please see this gif below:
ezgif-2-2114c5eb4d6a

It is rather small to see but basically when I am in page 2 and type "Cal" or "Texas", the datatable returns empty (even when Texas is in page 2). This has been tested on a larger dataset and the same issue occurs.

Below is the full sample code that replicate this issue:

import dash
import dash_table
import pandas as pd

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')

app = dash.Dash(__name__)

app.layout = dash_table.DataTable(
    id='table',
    columns=[{"name": i, "id": i} for i in df.columns],
    data=df.to_dict('records'),
	filter_action="native", 
	row_selectable="multi",
	page_action="native", 
	page_current=0,
	page_size=5,
)

if __name__ == '__main__':
    app.run_server(debug=True)
@pvtodorov
Copy link

same issue. is this going to be resolved?

@UrbanWaterhen
Copy link

UrbanWaterhen commented Apr 29, 2021

I've got same issue today.
I try to make a small callback to make the page to 0 when filter and it works. Hope that it will help.

@app.callback(
    Output('table', "page_current"),
    Input('table', "filter_query"))
def update_table(filter):
    return 0

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants