# Drop down in Power Table cell not working

**URL:** <https://forum.inductiveautomation.com/t/drop-down-in-power-table-cell-not-working/32162>\
**Category:** Ignition\
**Created:** [February 12, 2020, 1:44pm UTC](https://forum.inductiveautomation.com/t/drop-down-in-power-table-cell-not-working/32162 "2020-02-12T13:44:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neo](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@Neo](https://forum.inductiveautomation.com/u/Neo)\
**Post date:** [February 12, 2020, 1:44pm UTC](https://forum.inductiveautomation.com/t/drop-down-in-power-table-cell-not-working/32162/1 "2020-02-12T13:44:28Z")

</div>

I am trying to get the Power Table cell to show the drop down with multiple options. After going through few topics I found that it can be achieved using configureEditor extension function and Power Table already has the example for the same.  
So, now I have a power table with configureEditor enabled and with following script -

```auto
if colIndex == 0: 
		return {'options': [(0, 'A Shift'), (1, 'B Shift'), (2, 'C Shift')]}

```

isCellEditable extension function enabled with following script -  
`return True`  
But power table doesn’t show any drop down in first column. As per one of the topics on forum, user had faced same issue but it got resolved after restarting designer. I tried same but to no avail. I have tried this on version 8.0.7 and 8.0.5 to rule out bug possibility.

Am I missing anything?

---

<div class="post-metadata">

**Author:** ![camatt3](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@camatt3](https://forum.inductiveautomation.com/u/camatt3)\
**Post date:** [February 12, 2020, 9:02pm UTC](https://forum.inductiveautomation.com/t/drop-down-in-power-table-cell-not-working/32162/2 "2020-02-12T21:02:38Z")

</div>

Is the column checked as Editable in the Table Customizer?

---

<div class="post-metadata">

**Author:** ![Neo](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@Neo](https://forum.inductiveautomation.com/u/Neo)\
**Post date:** [February 13, 2020, 10:32am UTC](https://forum.inductiveautomation.com/t/drop-down-in-power-table-cell-not-working/32162/3 "2020-02-13T10:32:22Z")

</div>

I checked Editable option for the column but still it is not showing drop down menu 😭

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [February 13, 2020, 10:51am UTC](https://forum.inductiveautomation.com/t/drop-down-in-power-table-cell-not-working/32162/4 "2020-02-13T10:51:02Z")

</div>

The `configureEditor` method is only called when the power table gets loaded with the scripts active (so it doesn’t work in the designer). Make sure to test it in a client.

---

<div class="post-metadata">

**Author:** ![Neo](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@Neo](https://forum.inductiveautomation.com/u/Neo)\
**Post date:** [February 13, 2020, 12:24pm UTC](https://forum.inductiveautomation.com/t/drop-down-in-power-table-cell-not-working/32162/5 "2020-02-13T12:24:03Z")

</div>

Thanks a lot! It’s working now. I had checked it once in runtime but the Editable option was not checked.  
One more question, I see drop down menu only when I click on cell otherwise it is blank.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/631652290e9f5d21644201f595c365b22395ceec.png)  
I was expecting to drop down on un-selected cell as well. Is it possible?

---

<div class="post-metadata">

**Author:** ![camatt3](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@camatt3](https://forum.inductiveautomation.com/u/camatt3)\
**Post date:** [February 13, 2020, 8:31pm UTC](https://forum.inductiveautomation.com/t/drop-down-in-power-table-cell-not-working/32162/6 "2020-02-13T20:31:03Z")

</div>

You can use a custom renderer in the `configureCell` extension function on the Power Table.  
For example:

```auto
	from javax.swing import JComboBox
	# The same options from configureEditor, except as a dict
	options = {0: 'A Shift', 1: 'B Shift', 2: 'C Shift'}
	# Get the value to display
	if value in options:
		item = options[value]
	else:
		# "Invalid" option
		item = value
	# Create a combo box with only the current value
	jcb = JComboBox([item])
	jcb.setBorder(None)
	jcb.setBackground(self.background)
	return {'renderer': jcb}

```

---

<div class="post-metadata">

**Author:** ![Neo](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@Neo](https://forum.inductiveautomation.com/u/Neo)\
**Post date:** [February 29, 2020, 1:14pm UTC](https://forum.inductiveautomation.com/t/drop-down-in-power-table-cell-not-working/32162/7 "2020-02-29T13:14:19Z")

</div>

@camatt3 Thank you for sharing this script and apologies for late reply.  
When window opens I need to show the previously selected value in the drop down and also let user to select new value if required. I think I might need store selected value is database or dataset tag. I will check using above script how to get this working.

Thanks again!
