GroupDataGrid not displaying all rows post-grouping

Hi Jmix Support team,

We have found an issue for the recently added GroupDataGrid component. When we tried to use .groupByKey function to the GroupDataGrid with a DataContainer that contains an entity with CompositeKey, the grid will only show the first row after grouping them.
image
image

From the 2 screenshots above, it is shown that after I group by “currency” in my project, they only show the records under USD, but if I tried and trigger the table to sort by ascending order, it will show the grouped AUD records instead. Which means there are more than one “groups” of records in here but it only shows the first one. Please check on this whether this is a bug from the groupdatagrid-add-on, thank you.

P.S. “currency” is a field on my entity’s CompositeKey

Best Regards,
Wei Jian

Hello!

Could you share a small demo project with the problem or steps to reproduce it? I’ve tried to group by property from composite key but all existing rows are shown.

Hi,

Here is a sample project that shows that the GroupDataGrid is not working on an entity with CompositeKey:

Thank you for the demo project! I’ve created a GitHub issue: GroupDataGrid displays only one group row when entity has Embedded Id · Issue #5002 · jmix-framework/jmix · GitHub

As the workaround, you can add Has UUID trait to your entity.

Thank you @pinyazhin , please try to escalate this fix as soon as possible as there are many of our use cases affected by this bug.

Hi @pinyazhin ,

I encounter similar issue that the entity that has the composite key & grouping using the Transient entity field. I need to click the group data grid icon , it shows another record. Supposedly need to display all the record.
{A870B1C1-85B3-428C-8D67-F8C291C1030E}

{CA261287-F7DE-42E1-9E36-C8A14FDD245B}

Below is my code :

<groupg:groupDataGrid columnReorderingAllowed="true" dataContainer="do08incExpsDc"
                                          id="do08incExpsTable" sortByGroupEnabled="true"  multiSortOnShiftClickOnly="false" >
    <groupg:groupBy>
        <groupg:columnRef key="ssDescr" />
    </groupg:groupBy>
    <groupg:columns resizable="true">
        <groupg:groupColumn header="" key="group"  resizable="true" displayColumnsGrouperOnIconClick="false"   />
        <groupg:column property="ssDescr" />
        <groupg:column property="fldNm"/>
        <groupg:column property="num1"/>
    </groupg:columns>
</groupg:groupDataGrid>

ssDescr is transient in the entity

Hello!

Thank you for sharing the problematic case. We will additionally check it while resolving the issue.

In general, it is highly recommended that entities which do not automatically generate in-memory IDs define the Has Uuid trait. For more information see Entities :: Jmix Documentation

Hi @pinyazhin
cc : @wjong
Thank you for the updated. today , I encountered a new issue with the Group Data Grid, where the group column is not displayed correctly.

<groupg:groupDataGrid columnReorderingAllowed="true" dataContainer="sy98prodFltrsDc" id="browseTable" width="100%">
    <groupg:actions>
        <groupg:action id="create" type="list_create"/>
        <groupg:action id="edit" type="list_edit"/>
        <groupg:action id="remove" type="list_remove"/>
    </groupg:actions>
    <groupg:groupBy>
        <groupg:columnRef key="prodDescr"/>
    </groupg:groupBy>
    <groupg:columns resizable="true">
        <groupg:groupColumn key="prodDescrGroup" header="msg://prodDescrGroup"
                            resizable="true"/>
        <groupg:column property="prodDescr"/>
        <groupg:column property="fccdDescr"/>
        <groupg:column property="brnDescr"/>
        <groupg:column property="grpDescr"/>
        <groupg:column property="id.grpLvl"/>
        <groupg:column property="crtActn"/>
        <groupg:column property="inqActn"/>
        <groupg:column property="trnActn"/>
    </groupg:columns>
</groupg:groupDataGrid>

prodDescr is transient field in the entity.
when open the screen , it displayed as below
{4D597104-76A7-4D06-AA09-FF6286C99365}

What I did was to click the up down arrow button in the header.
{FA406E2A-AE34-49B2-97E9-7276EAD08E46}

it only display the data properly.
image

I really appreciate your support .

Best Regard,
Chee Hao

Hello, Chee Hao!

This probably happens when you initialize the transient property after grouping has been performed. As a workaround, you can remove the grouping from XML and apply it programmatically after your property is fully initialized.

I’ve created a GitHub issue: GroupDataGrid does not update grouping when a value of the group property changes · Issue #5117 · jmix-framework/jmix · GitHub

Regards,
Roman