menuFilterField

The menuFilterField component allows users to filter main menu items by their text labels using entered value.

  • XML element: menuFilterField

  • Java class: MenuFilterField

Основы

Below is an example of using the menuFilterField component in the main view:

<menuFilterField placeholder="Search..."
                 classNames="ms-s me-s"
                 menu="menu"/> (1)
<nav id="navigation"
     classNames="jmix-main-view-navigation"
     ariaLabel="msg://navigation.ariaLabel">
    <listMenu id="menu"/>
</nav>
1 The menu attribute should point to a listMenu component to be filtered.
menuFilterField
Обратите внимание, что фильтрация horizontalMenu не поддерживается.

Варианты темы

Используйте атрибут themeNames для настройки темы компонента.

Вариант Описание Поддерживается в

align-left

Выравнивает значение поля по левому краю.

Aura, Lumo

align-center

Выравнивает значение поля по центру.

Aura, Lumo

align-right

Выравнивает значение поля по правому краю.

Aura, Lumo

align-start

Выравнивает значение поля по начальной стороне с учетом текущего направления текста.

Aura

align-end

Выравнивает значение поля по конечной стороне с учетом текущего направления текста.

Aura

helper-above-field

Размещает вспомогательный текст над полем, под меткой.

Aura, Lumo

small

Уменьшает размер компонента.

Aura, Lumo

Атрибуты

filterMode

The filterMode attribute sets the filter mode for menuFilterField. It is used to control how the filter behaves when searching for matching items. Here are the possible values for the filter case sensitivity:

  • CASE_SENSITIVE - the filter string case will not be ignored, meaning that the filter will be case-sensitive.

  • CASE_INSENSITIVE - the filter string case will be ignored, meaning that the filter will be case-insensitive.

The menu attribute should point to a listMenu component to be filtered. This attribute is required.

Обработчики

Чтобы сгенерировать заглушку обработчика в Jmix Studio, используйте вкладку Handlers панели инспектора Jmix UI, или команду Generate Handler, доступную на верхней панели контроллера экрана и через меню CodeGenerate (Alt+Insert / Cmd+N).