# Force configure cell update in power table

**URL:** <https://forum.inductiveautomation.com/t/force-configure-cell-update-in-power-table/16318>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [December 14, 2017, 2:04am UTC](https://forum.inductiveautomation.com/t/force-configure-cell-update-in-power-table/16318 "2017-12-14T02:04:25Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 15, 2017, 12:26am UTC](https://forum.inductiveautomation.com/t/force-configure-cell-update-in-power-table/16318/7 "2017-12-15T00:26:20Z")

</div>

The much more efficient solution is to embed a custom editor, which will lookup the datasets dynamically whenever it’s appropriate. I’ve got a very simple example of this below; the project has an editable ‘Options’ dataset, and the available options in column B in the editable table will be dynamic based on the value in column A.

The relevant code is here:

```auto
		root = self
		from javax.swing import JComboBox, DefaultCellEditor, DefaultComboBoxModel
		
		class CustomCellEditor(DefaultCellEditor):
			def getTableCellEditorComponent(self, table, value, isSelected, row, column):
				comp = DefaultCellEditor.getTableCellEditorComponent(self, table, value, isSelected, row, column)
				data = []
				target = root.parent.getComponent("Options")
				for r in range(target.data.rowCount):
					if target.data.getValueAt(r, 0) == root.data.getValueAt(row, 0):
						data = target.data.getValueAt(r, 1).split(",")
				comp.setModel(DefaultComboBoxModel(data))
				return comp
		return {'editor': CustomCellEditor(JComboBox())}

```

Specifically, `comp.setModel(DefaultComboBoxModel(data))` - every time the table asks the editor what renderer it should use, the `CustomCellEditor` will fire `getTableCellEditorComponent` and refresh the data in the dropdown.

[Custom Editor.proj](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/40a9785686270d7a1edf294e01dcbfc64cbd56a5.proj) (9.2 KB)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9077be1a7042317830f8bfbe28ced855f3524f1d.gif)

---

_[View the full topic](https://forum.inductiveautomation.com/t/force-configure-cell-update-in-power-table/16318)._
