# Power table button

**URL:** <https://forum.inductiveautomation.com/t/power-table-button/17933>\
**Category:** Ignition\
**Created:** [May 6, 2018, 6:41am UTC](https://forum.inductiveautomation.com/t/power-table-button/17933 "2018-05-06T06:41:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claus\_Nielsen](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Claus\_Nielsen](https://forum.inductiveautomation.com/u/Claus_Nielsen)\
**Post date:** [May 6, 2018, 6:41am UTC](https://forum.inductiveautomation.com/t/power-table-button/17933/1 "2018-05-06T06:41:19Z")

</div>

I know this has been asked some times now, however can’t make it work properly.

I can successfully add buttons to the power table, it is just not performing very well. The power table flashes and is unresponsive. Have been following [this](http://forum.inductiveautomation.com/t/power-table-custom-renderer-with-jbutton/11970) to get startet, but as said without any luck.

Is anyone doing this with success?

Here’s the code snippet from the configureEditor extension functions (copied directly from the linked thread)

```auto
if colName == "String Column":
	from javax.swing import AbstractCellEditor, JButton
	from javax.swing.table import TableCellEditor
	def func(e):
		print "This works. My Test."			
	class MyCellEditor(AbstractCellEditor,TableCellEditor):
		def getTableCellEditorComponent(self,table,value,isSelected,row,column):
			return JButton("My Button",actionPerformed=func)
	return {'editor':MyCellEditor()}

```

and the configureCell

```auto
if colName == "String Column":
    from javax.swing import JButton
    return { 'renderer' : JButton("My Button") }

```

Tried moving the code to a script module to remove the imports from every call,  
Also, tried creating a JButton object and return this instead of creating a new object every call.  
Either attempt didn’t have any effect on performance.

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [May 7, 2018, 3:03pm UTC](https://forum.inductiveautomation.com/t/power-table-button/17933/2 "2018-05-07T15:03:35Z")

</div>

Did you make sure that “String Column” is set as Editable in the Table Customizer?

---

<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:** [May 7, 2018, 3:24pm UTC](https://forum.inductiveautomation.com/t/power-table-button/17933/3 "2018-05-07T15:24:32Z")

</div>

In terms of performance - removing the imports from the potentially frequently run extension functions (_especially_ `configureCell`) is going to give you huge gains. I would recommend importing your JButton as a cached property in the `initialize` function (`self.setClientProperty("button", JButton("My Button")` | `return { 'renderer': self.getClientProperty("button")}`)

---

<div class="post-metadata">

**Author:** ![Claus\_Nielsen](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Claus\_Nielsen](https://forum.inductiveautomation.com/u/Claus_Nielsen)\
**Post date:** [May 8, 2018, 7:00am UTC](https://forum.inductiveautomation.com/t/power-table-button/17933/4 "2018-05-08T07:00:31Z")

</div>

I tried both, still the same.
