Filtering not working
emilhe opened this issue · comments
Emil Haldrup Eriksen commented
I tried to use the built-in filtering, but i can't get it to work. When i type something in the filter, the rows are filtered as intended, but the filtering section itself is cleared. Here is an mwe,
import dash_tabulator
import dash
import dash_html_components as html
# Setup some data
columns = [
{"title": "Name", "field": "name", "width": 150, "headerFilter": True, "editor": "input"},
{"title": "Print", "field": "print", "hozAlign": "center"}
]
data = [
{"id": 1, "name": "Oli Bob", "print": "stuff1"},
{"id": 2, "name": "Mary May", "print": "stuff2"},
]
# Create example app.
external_stylesheets = ['https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css',
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div([
dash_tabulator.DashTabulator(id='tabulator', columns=columns, data=data),
])
if __name__ == '__main__':
app.run_server(debug=False, port=7777)
NB: This issue might be cause by this underlying bug.
patrick oleary commented
@emilhe this should be resolved now, render() was getting called with every setProps which sends updates back to dash, and the component was resetting the display.
I'm actually surprised that tabulator worked with the amount of times render was getting called, it must have solved a lot of these issues in react-tabulator
If you update it should be fixed now