plotly / dash-table-experiments

NO LONGER SUPPORTED - use https://github.com/plotly/dash-table instead
MIT License
174 stars 57 forks source link

bug in select with duplicate rows #16

Open sdementen opened 6 years ago

sdementen commented 6 years ago

Hello,

I have a simple table with [{"name":"name-1"}, ...]. When two or more rows (here names) are the same, selecting one of these rows leads to the selection of the first row among them. When "selecting all", only the first of each of the similar rows are selected. Is it clear as description ?

chriddyp commented 6 years ago

Thanks for reporting @sdementen ! Ugh, yes, I see what's going on here.

To workaround this issue right now, try adding a hidden column with unique indices, i.e.

rows=[
   {'id': 0, 'a': 1, 'b': 3},
   {'id': 1, 'a': 5, 'b': 2},
   ...
   {'id': 999, 'a': 2, 'b': 3},
]
columns = ['a', 'b'] # by excluding 'id', we won't display it

DataTable(rows=rows, columns=columns)
sdementen commented 6 years ago

great, tx for the fix!