Skip to main content

Posts

Showing posts from April, 2014

Show Hide Filters Dynamically

Show/ Hide Filters in FilterPanel based on user Selections in text area

Add a text area where the user can select the columns for which the filters should be visible.
Then in the filter property attach the following script. filterlist is the property behind the multiselection listbox import Spotfire.Dxp.Application.Filters as filters
import Spotfire.Dxp.Application.Filters.ListBoxFilter
from Spotfire.Dxp.Application.Filters import FilterTypeIdentifiers
from Spotfire.Dxp.Data import DataPropertyClass
from System import String
myPanel = Document.ActivePageReference.FilterPanel
strVals =  Document.Properties["filterlist"]
myPanel.TableGroups[0].Visible = True
for filter in myPanel.TableGroups[0].Items:
    filter.Visible = False
for strval in strVals:
    myFilter= myPanel.TableGroups[0].GetFilter(strval)
    myFilter.Visible = True