I don’t understand how the selected rows in (release 0.7.0) Panel’s DataFrame widget interact with Python. Taking the DataFrame documentation as a basis and running it in a Jupyter notebook
table.selection = [0, 2]
correctly highlights the corresponding rows in the widget, which can then be extracted with table.selected_dataframe. So far, so good. But:
- If I click on another row, it gets highlighted, but
table.selectiondoes not change. - Consequently, attaching a watcher to
table.selectionachieves nothing. - I found out that
table.selectedacutally contains a list of the rows I select with the mouse. This is the behaviour I expected fromtable.selection. - After selecting some lines,
table.selected_dataframestill extracts the rows fromtable.selection, not fromtable.selected - I cannot attach a watcher to
table.selected, because then I get:
ValueError: selected parameter was not found in list of parameters of class DataFrame
Is this the intended behaviour? If so, could someone please explain it to me? All I want to do is show a non-editable DataFrame with a checkbox column, where the checkbox toggles if the user clicks on the corresponding row (and I see this change in Python). I should mention that I did play around a little with Bokeh’s CheckboxEditor, but didn’t get it to work properly (even if it did work as intended, I think you would have to click three times on a row to toggle the box: select, switch on edit mode, toggle checkbox).
Any help is greatly appreciated!
Thanks,
Martin