Field-selector angular component with grouping

Hi

Im trying to create a custom property with the field-selector component. I can see there is a bool property called grouping. And for the data I have groupName set, but when I set grouping to true the only groupname that shows up in the component is the name “Fields”.

    <field-selector #control 
        [manualFetch]="true" 
                    [value]="items"
                    [sortable]="false"
                    [grouping]="true"
                    [fields]="fields$ | async"
                    [idSelector]="idSelector"
                    [stateSelector]="stateSelector"
        (valueChange)="onFieldSelect($event)"
    ></field-selector>

Items data:

[{“title”:“Raven-46”,“fieldId”:"Field1,“groupName”:“WE_STOFF”},{“title”:“Shadow-45”,“fieldId”:“Field2”,“groupName”:“WE_STOFF”},{“title”:“Navy-61”,“fieldId”:“Field3”,“groupName”:“WE_BEN”}]

Is it possible to enable grouping for the items?

Litium version: 8.4.1

Unfortunately the grouping is used only for grouping System fields, by the systemDefined prop.

But you can sort your input fields, and group them by yourself, maybe from the server side. The group item is just like a normal item, but with a isGroup prop as true, and you define the title text.

For example, you would want to add this item as the first item:

{“title”:“WE_STOFF”,“isGroup”:true}

@ton.nguyen That works, thank you! Only one minor issue now, the first group seems to always be selectable, maybe a bug in the component?

Sounds like a bug. Can you please create one? Login

Cheers

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.