I want to remove the Setting button in the Filter box while keeping everything else the same.
I tried extending the filter layout (where I found this setting button) but this filter fragment cant be extended/changed (or I haven’t done it right). Please provide a detail explanation if possible.
Hello!
Settings button availability is managed by specific security permission - ui.filter.modifyConfiguration
. Just do not assign this permission to users and they won’t see the button.
I tried that but we need the “Add search condition” because we want the customers to be able to customize the search fields themselves. This is not available if we remove ui.filter.modifyConfiguration
So you can try to extend Filter
component and register it application.
- Extend
FilterImpl
class and hide settings button:@CompositeDescriptor("filter.xml") public class ExtFilterImpl extends FilterImpl { @Override protected void initSettingsButton() { super.initSettingsButton(); settingsButton.setVisible(false); } }
- Copy XML descriptor for Filter and place it in resources with the same path to your
ExtFilterImpl
.
filter.xml
<composite xmlns="http://jmix.io/schema/ui/composite">
<groupBox width="100%"
orientation="vertical"
collapsable="true"
spacing="true">
<responsiveGridLayout id="filter_controlsLayout"
stylename="px-0">
<row alignItems="CENTER"
guttersEnabled="false">
<col xs="AUTO" stylename="pr-2">
<cssLayout id="filter_searchLayout"
stylename="v-component-group"
width="100%">
<button id="filter_searchButton"
icon="SEARCH"
stylename="friendly"
shortcut="SHIFT-ENTER"/>
<popupButton id="filter_selectConfigurationButton"
stylename="icon-only friendly"/>
</cssLayout>
</col>
<col sm="DEFAULT" stylename="pt-2 pt-sm-0">
<linkButton id="filter_addConditionButton"
caption="msg:///filter.addConditionButton"/>
</col>
<col xs="AUTO" stylename="pt-2 pt-sm-0">
<popupButton id="filter_settingsButton"
icon="GEAR"
stylename="icon-only"/>
</col>
</row>
</responsiveGridLayout>
</groupBox>
</composite>
- Register your extension to replace Jmix
FilterImpl
:@Bean public ComponentRegistration extFilter() { return ComponentRegistrationBuilder.create(Filter.NAME) .withComponentClass(ExtFilterImpl.class) .build(); }