ipysheet dropdown can only be added at cell level?

Viewed 69

For for ipysheet all of row, column, cell_range and cell methods have a parameter choice which can be used for generating a dropdown. See https://i.stack.imgur.com/tkGut.jpg.

But it seems only cell works. See code below. In https://i.stack.imgur.com/6fjqy.png, only the cell at row 1 and column 0 has a dropdown. while others, though specified a choice option, are not displaying the dropdowns.

Any suggestions would be appreciated!

import ipysheet
sheet = ipysheet.sheet(rows=5, columns=4)
row = ipysheet.row(0, [0, 1, 2, 3], background_color="red", choice = ['1', '2'])
column = ipysheet.column(1, ["a", "b", "c", "d"], row_start=1, background_color="green", choice = ['1', '2'])
cell_range = ipysheet.cell_range([["hi", "ola"], ["ciao", "bonjour"], ["hallo", "guten tag"]],
                                  row_start=1, column_start=2, background_color="yellow", choice = ['1', '2'])
cell = ipysheet.cell(row = 1, column = 0, value = 'Tom', choice = ['Tom', 'Jerry'])
sheet
1 Answers

I was able to make it work with the column function by also passing the type as dropdown.

I think the documentation is incorrect for that function as it says

type description

api reference

However it seems that just passing choice in argument is not working. You also have to pass the type as dropdown

Here we can see the difference between the two calls:

without the type argument

enter image description here

with the type argument

enter image description here

The latest will return a Cell object containing all the values for this column, you can use it to initialize your sheet:

enter image description here

Related