My goal is to provide a dropdown on the column for the user to select. I have tried many versions of this same idea that I have found on the forum, but no luck. If I click to edit the column, it presents the standard edit function for the table. I tried a print command to see if it is firing, but I it doesn't output anything to the console.
I also have isCellEditable returing True
Has anyone else had issues using the ConfigureEditor function to display a dropdown?
Good catch, I tried that, with the same result. To start from scratch, I dropped a new Power Table on the window, had it populate with "Test Data". I then put the following in configureEditor and set isCellEditable to return True
if colName == 'String Column':
return {'options': [(0, 'A Shift'), (1, 'B Shift'), (2, 'C Shift')]}
Still, it just allows me to type in whatever I want in the the text box, without a dropdown.
Good question. To start with a clean slate, I started over with a new powertable and used the âTestDataâ property to populate it with test data. The testdata includes a column called String Column.
I just restarted the designer and it started working! It wasnât firing before, I tried the print solution earlier and it never fired. Now its firing just as it should, and I have a drop down now!
Next step: I use Postgres to create and populate a table with two varchar columns. Bind powertable data property to select sql table data.
Now it seems configureEditor is not firing at all.
I reset property bindings to no-bindigs but configureEditor still not working.
I will appreciate any help to understand whatâs changing with the sql binding, or how to get a powertable sourced from a database working with a cell drop-down editor.
HI,
I had the same problem. I needed to dynamically make a cell editable/ non-ediatble. Also, the dropdown was to be displayed in the cell only when it is editable.
The issue was that the configureEditor function was not being called after the isCellEditable function. The way I solved it was to check the âeditableâ checkbox for the required column in the âColumn Attributes Dataâ property of the Power Table. This makes all the rows of the column editable. Further, the isCellEditable function filters the cells that need to be non-editable. After this, the configureEditor function is called to populate the dropdown.
See if this Topic helps. If you scroll down to the solution you can see two examples of drop down cells within Power Tables. One is defined and the other pulls its data from mysql table.