# Unsort power table script

**URL:** <https://forum.inductiveautomation.com/t/unsort-power-table-script/30974>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [December 30, 2019, 3:44pm UTC](https://forum.inductiveautomation.com/t/unsort-power-table-script/30974 "2019-12-30T15:44:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcrownover](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rcrownover/32/17805_2.png) [@rcrownover](https://forum.inductiveautomation.com/u/rcrownover)\
**Post date:** [December 30, 2019, 3:44pm UTC](https://forum.inductiveautomation.com/t/unsort-power-table-script/30974/1 "2019-12-30T15:44:01Z")

</div>

I know there are already some answers on the forum to trigger a sorting of a power table on init or button press. This works well enough. What I cannot seem to figure out is how to “unsort” a power table.

I have a toggle that swaps a power table from being “sortable” and “unsortable” and need to clear any “sort selected” columns when the swap to “unsortable” happens. So far, I have tried the following code, which causes erratic behavior of the sorting function (probably because I have misunderstood the intersection of the JTable and JideTable objects). The JideTable has some warnings about not using the JTable sorter in their documentation, but it appears that the Power Table is using the JTable sorting. I can’t ‘sort’ it out (pun intended).

```auto
	jTable = tableComponent.getTable()
	jTable.setAutoCreateRowSorter(False)
	jTable.unsort()
	jTable.setAutoCreateRowSorter(True)

```

I’ve also tried the method `jTable.getRowSorter().setSortKeys(None)`. But the `jTable.getRowSorter()` returns `None`.
