Programmatically-applied PowerTable Filters

			model = self.getTable().getModel().getActualModel()
			from com.jidesoft.grid import SingleValueFilter
			class newFilter(SingleValueFilter):
				def isValueFiltered(self, value):
					return True if value == target.data.getValueAt(row, 4) else False
			model.addFilter(3, newFilter())
			model.setFiltersApplied(True)
			model.refresh()

I’ve used this code before to successfully apply a filter (shows the filter icon in the table header correctly), and it also allows it to be removed by selecting ‘All’ from the dropdown; I suspect that the EqualFilter you’re using doesn’t do everything necessary to interact with the table.

1 Like