# Power table - reset filters

**URL:** <https://forum.inductiveautomation.com/t/power-table-reset-filters/12537>\
**Category:** Ignition\
**Created:** [January 10, 2017, 6:12pm UTC](https://forum.inductiveautomation.com/t/power-table-reset-filters/12537 "2017-01-10T18:12:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kstofcho](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@Kstofcho](https://forum.inductiveautomation.com/u/Kstofcho)\
**Post date:** [January 10, 2017, 6:12pm UTC](https://forum.inductiveautomation.com/t/power-table-reset-filters/12537/1 "2017-01-10T18:12:14Z")

</div>

I am looking for a way to remove filter selections/reset filter to all (to be placed in the internal frame closing script on pages) in a power table. I couldn’t find anything related to resetting filters in documentation or scripting areas. Perhaps there is a way to make columns un filterable then make them filterable again as a way to reset. I couldn’t find a way to accomplish this either, however. Any ideas? Thanks!

---

<div class="post-metadata">

**Author:** ![Aaron.Huffman](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Aaron.Huffman](https://forum.inductiveautomation.com/u/Aaron.Huffman)\
**Post date:** [March 9, 2017, 1:00am UTC](https://forum.inductiveautomation.com/t/power-table-reset-filters/12537/2 "2017-03-09T01:00:51Z")

</div>

Forgive the last line of this script:

```auto
table = event.source.parent.getComponent('Power Table')

table.getTable().getTableHeader().clearFilters()
table.data = table.data
```

This will reset your filter(s). There are more elegant ways of triggering a table repaint than simply reinitializing the data in the table, but the usual suspects didn’t quite work when I mocked this up. For you this might be a system.db.refresh() call or some other assignment.

---

<div class="post-metadata">

**Author:** ![jsorlie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jsorlie/32/3645_2.png) [@jsorlie](https://forum.inductiveautomation.com/u/jsorlie)\
**Post date:** [December 7, 2018, 8:29pm UTC](https://forum.inductiveautomation.com/t/power-table-reset-filters/12537/3 "2018-12-07T20:29:08Z")

</div>

Alternately without that fun last line, create a custom method for the power table like this

```auto
def clearFilters(self):
	model = self.getTable().getModel().getActualModel()
	model.clearFilters()
	model.setFiltersApplied(True)
	model.refresh()

```

documentation link: [http://www.jidesoft.com/javadoc/com/jidesoft/grid/FilterableTableModel.html](http://www.jidesoft.com/javadoc/com/jidesoft/grid/FilterableTableModel.html)

To selective clear filters by column

```auto
	model = self.getTable().getModel().getActualModel()
	def clearFilters(col):
		if model.hasFilter(col): [model.removeFilter(col,filter) for filter in model.getFilters(col)]
	clearFilters(col)
	clearFilters(0)
	clearFilters(1)
	clearFilters(3)

```
