Multiple Values Filter on Power Table

I am currently working with filters on a power table and found a script that works for a single value, but I have not found a way to use jidesoft MultipleValuesFilter in it’s place; I also haven’t been able to find any good documentation or examples of this.

def setFilter(self, filters):
model = self.getTable().getModel().getActualModel()
model.clearFilters()
from com.jidesoft.grid import MultipleValuesFilter

for f in filters:
	class newFilter(MultipleValuesFilter):
		def isValueFiltered(self, value):
			return bool( value != f ) 
	model.addFilter(0, newFilter())
	
model.setFiltersApplied(True)
model.refresh()	

This is what I have attempted to put together so far, using the script that I already was using for singlevaluefilter. I pass through an array as the parameter “filters” in a propertyChanged event script, but it creates a new filter that overwrites the last one for each element of the array/list rather than adding it together. I’m not quite sure where to go from here, so any help would be appreciated!
Thank you.

I think you’re trying to use MultipleValuesFilter in the wrong way.

Reading the Javadoc, it looks like it just expects you to provide a list of allowed values when you construct it. It’s not OR-ing together multiple filters.

1 Like

From the Javadoc on IFilterableTableModel, it looks like it should be fine to directly apply multiple filters to one column; you can just set the setAndMode(boolean) to choose AND vs OR behavior for the filters.

1 Like

@PGriffith
Apologies for resurrecting an old thread, but the link to the JIDE javadoc is now 404. Is there any other way Ignition (Vision) users can access that documentation?

I can’t vouch for the legitimacy of the site, but searching IFilterableTableModel led me to a third party archive of Jide’s Javadocs:
https://www.mvndoc.com/c/org.bidib.com.jidesoft/jide-grids/com/jidesoft/grid/IFilterableTableModel.html