Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Table does not default to page 1 after filtering #635

@Jobbalob

Description

@Jobbalob

After filtering a column in the table, page number is not reset to 1. This causes no problem when filtering is applied whilst page 1 is being inspected, but when looking at a higher page, if the filter applied reduces the size of the table to below the current page number, the forward and previous buttons are removed and navigation becomes impossible.

The buttons return upon removal of the filter, but it can be bothersome to have to return to page 1 before applying any filters.

import numpy as np
import pandas as pd
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_table



data = {'numbers': np.arange(0,100)}
df = pd.DataFrame(data, columns=['numbers'])


app = dash.Dash(__name__)

app.layout = html.Div(
			style = {'width':'48%'},
			className = 'table-container',
			children=dash_table.DataTable(
					columns = [{'name' : i, 'id' : i} for i in df.columns],
					data=df.to_dict('records'),
					editable=False,
					filter_action="native",
					filter_query='',
					sort_action="native",
					row_deletable=False,
					selected_columns=[],
					selected_rows=[],
					page_action="native",
					page_current= 0,
					page_size= 12,
				),
			)



if __name__ == '__main__':
	app.run_server(debug=False)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions