If you want to reuse settings across multiple instances of a component, you can use setting groups.
Consider an example with the Dropdown
component.
Without using setting groups, each instance of the Dropdown
component needs to have a unique identifier assigned.
But if we already know the locations of the button and the content, we can link them using the toggler
option.
If the group is not declared through
Dropdown.data()
, the dropdown won’t be initialized after callingDropdown.initAll()
.
Also, if an empty string ''
is passed instead of a name or skip it, then the provided settings will apply to all dialogs with the data-ui-dialog
attribute where no name is specified.
Consider an example with the Tablist
component.
Tablist has predefined setting groups such as 'ui-accordion'
(default) and 'ui-tabs'
.
Let’s create tabs and arrange so that we do not need to manually link each tab to a panel via the id
attribute.
After that the settings will look like this: