Jump to content

After creating an initial button in the textarea, how to set the default value for the first item in the radio button (when there is no All option)


Min Su Sun

Recommended Posts

After creating an initial button in the textarea, how to set the default value for the first item in the radio button (when there is no All option)

I made an initial button and a radio button (if there is no All option) in the textarea.

I want to create a function that initializes all filters when the initail button is clicked and defaults the first item to the radio button without the All option. I would appreciate it if you could let me know if there is a way to satisfy all of the features below.

When clicking the initial button

1. Reset all filters

2. Set the first item of the radio button without All to be automatically selected

3. Set the message not to appear only in the case

2.png.07132d42e2978bfa80300173f4a24bc8.png3.png.98bfd1b24de6005c96a0f3ec4e99211f.png 

1.png.a94264ebd6fbfeb0ae5af4d9348cfce5.png

Link to comment
Share on other sites

This script does the reset first, then removes the All option and sets the filter to its first value.

However, if you were to reset the filters from the Filter Panel, you would get the warning.

You can still show the All option and set the filter to the first value, it will select the individual value and not the All option.

from Spotfire.Dxp.Application.Filters import RadioButtonFilter table = Document.Data.Tables['your table name']filtering_scheme = Document.FilteringSchemes[0] #first scheme availablecolumn_name = 'your column name'myfilter=filtering_scheme.Item[table].Item[table.Columns.Item[column_name]].As[RadioButtonFilter]() myfilter.Reset()myfilter.ShowNone=Falsemyfilter.AllowAll=False values= myfilter.Valuesfirst_value = min(values)myfilter.Value=first_value
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...