DoubleClickAction on a prefiltered TableDisplay
- Dominant language
- Jupyter Notebook
- Stars
- 2.9k
- Forks
- 383
- PR merge metrics
- No merged PRs in 30d
Description
Ok, I am playing with the TableDisplay as described in your Python Table API:
```
mapList4 = [
{"a":1, "b":2, "c":3},
{"a":4, "b":5, "c":6},
{"a":7, "b":8, "c":5}
]
display = TableDisplay(mapList4)
def dclick(row, column, tabledisplay):
tabledisplay.values[row][column] = sum(map(int,tabledisplay.values[row]))
display.setDoubleClickAction(dclick)
def negate(row, column, tabledisplay):
tabledisplay.values[row][column] = -1 * int(tabledisplay.values[row][column])
def incr(row, column, tabledisplay):
tabledisplay.values[row][column] = int(tabledisplay.values[row][column]) + 1
display.addContextMenuItem("negate", negate)
display.addContextMenuItem("increment", incr)
display
```
This works like a charm. However, if I restrict the rows displayed by searching for a particular substring it all falls over. row and column still refer to the full display, e.g. let's say I only display the row with Index 2. Beakerx assumes I have clicked on row 0 and will apply the maths to this row rather than row 2 of the visible display. Does this make sense?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.