PowerTable Dropdown, always show option set by configureEditor

I’ve been working on a CRUD project. I needed to make sure to only allow certain options for updates in a table. I’ve already done this using the configureEditor extension function.

Let’s say table1 has a column referencing the id column of another table, I want to display the description/name of the corresponding value of that ID. I already show those in my dropdown, but want to show those even when the cell isn’t selected.

I want to always show the currently selected value in the dropdown instead of the underlying ID that’s actually in my table. Is this possible?

You should be able do that in the configureCell function. There you should be able write an expression based on your colName or colIndex to set the value in that column based on the ID. The ID will come in as your textValue, then you can do a query against the same info your using to create your dropdown in order to set the new value. I’m not able to test it out right now but you should be able to return it using the ‘text’ attribute.

1 Like