Jump to content
We've recently updated our Privacy Statement, available here. ×

Reset button for each page/ Reset button for all pages


Min Su Sun

Recommended Posts

I have two buttons in textarea.

One button should be a function that initializes the filter only for that page,

The other button should be a function to initialize all pages.

In this case, how should I configure the filter?

And is it possible with a script?

Link to comment
Share on other sites

Hello Min

Not sure what you mean by initialize the filter. Do you mean set the filter to a specific value? Do you want to reset visible filters or reset all filters from a particular filtering scheme? How many filtering schemes do you have? If you have only one, all pages will be affected when resetting that one filtering scheme. If you have a different filtering scheme for each page, then you can reset the active filtering scheme

Button 1. Reset filters from the active page current filtering scheme

activePage = Document.ActivePageReference Document.FilteringSchemes[activePage.ActiveFilteringSelectionReference].ResetAllFilters()

Button 2. Reset the selected filtering scheme from each page

for page in Document.Pages: Document.FilteringSchemes[page.ActiveFilteringSelectionReference].ResetAllFilters()

Reset all filtering schemes (on all pages):

for scheme in Document.FilteringSchemes: scheme.ResetAllFilters()

 

Edited by Jose Leviaguirre
Link to comment
Share on other sites

  • 7 months later...

Hola Tocayo!
 

#1. Take the filter panel from the desired page in filter panel
#filterPanel = Document.Pages[1].FilterPanel
filterPanel = Document.ActivePageReference.FilterPanel

#1.1 Select the filtering scheme to use (optional)
#filterringScheme = Document.FilteringSchemes[Document.Data.Filterings["Filtering scheme"]]
#filterPanel.FilteringSchemeReference = filteringScheme 

#2. Reset only visible filters
for tableGroup in filterPanel.TableGroups:
   for filterHandle in tableGroup.FilterHandles:
      if filterHandle.Visible:
         filterHandle.FilterReference.Reset()

 

 

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...