# Dynamic drop down values in table

**URL:** <https://forum.inductiveautomation.com/t/dynamic-drop-down-values-in-table/12354>\
**Category:** Ignition\
**Created:** [November 14, 2016, 6:33pm UTC](https://forum.inductiveautomation.com/t/dynamic-drop-down-values-in-table/12354 "2016-11-14T18:33:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [November 14, 2016, 6:33pm UTC](https://forum.inductiveautomation.com/t/dynamic-drop-down-values-in-table/12354/1 "2016-11-14T18:33:32Z")

</div>

Create a power table with test data and paste the following into the configureEditor extension function.  
Make the String Column editable.

[code] from javax.swing import AbstractCellEditor,JComboBox  
from javax.swing.table import TableCellEditor

```
class myTableCellEditor(TableCellEditor,AbstractCellEditor):	

	def __init__ (self, tableComponent):
		self.table= tableComponent
		self.cbValues = None
	
	def getTableCellEditorComponent(self, table, value, isSelected, rowIndex, vColIndex):	
		# Contents of dropdown will be dependant on this value.
		intColumnValue = self.table.data.getValueAt(rowIndex,"Int Column")
	
		# You can change this to query a database table or hardcode values 
		newList = [intColumnValue + i for i in range(0,10)]

		# Build the Combo box with the values from above
		self.cbValues = JComboBox(newList)

		return self.cbValues
	
	def getCellEditorValue(self):
		return self.cbValues.getSelectedItem()

if colName == "String Column":
	m = myTableCellEditor(self)
	return {"editor":m}[/code]
```
