plotly / dash-table

OBSOLETE: now part of https://github.com/plotly/dash
https://dash.plotly.com
MIT License
419 stars 74 forks source link

[BUG] Possible conflict between filter_action='native' and row_selectable='multi' #826

Open gaboc4 opened 4 years ago

gaboc4 commented 4 years ago

While trying to display a simple DataTable in Dash==1.13.4 there seems to be an issue when using both filter_action='native' and row_selectable='multi'.

There are no errors thrown in the stack trace and the data and columns print in the logs but the table doesn't display in the browser. When the page is inspected it just shows an empty div.

Here is the entire table with some dummy data:

DataTable(
                            id='test_table',
                            style_cell={'text-align': 'right'},
                            page_current=0,
                            page_size=10,
                            page_action='native',
                            sort_action='native',
                            sort_mode='single',
                            data=[{"first":[1, 2, 3, 4], "second":[5, 6, 7, 8]},
                            columns=[{"name":"first", "id":"first"}, {"name":"second", "id":"second"}],
                            sort_by=[],
                            filter_action='native',
                            row_selectable='multi',
                            selected_rows=[]
                        ) 
alexcjohnson commented 3 years ago

@gaboc4 do you still have a problem with this? I can't reproduce it, either with dash 1.13.4 or with the latest dash 1.16.3. Here's the complete app I'm using:

import dash
from dash_table import DataTable

app = dash.Dash(__name__)

app.layout = DataTable(
    id='test_table',
    style_cell={'text-align': 'right'},
    page_current=0,
    page_size=10,
    page_action='native',
    sort_action='native',
    sort_mode='single',
    data=[{"first": [1, 2, 3, 4], "second": [5, 6, 7, 8]}],
    columns=[{"name": "first", "id": "first"}, {"name": "second", "id": "second"}],
    sort_by=[],
    filter_action='native',
    row_selectable='multi',
    selected_rows=[]
)

if __name__ == "__main__":
    app.run_server(debug=True)

(note there's a missing ] after data in your post, but I'm assuming that's not actually missing in the app you were running)