Open Closed

Column sorts not working in dependent module listings - Blazor Server #4643


User avatar
0
balessi75 created

ABP Commercial 7.0.1 / Blazor Server / EF / Non tiered

We noticed that, if we extend a dependent module's entity with a new column (for example, adding an 'EmployeeId' property to the IdentityUser entity), the new property is listed in the gird, but it's sort does not work properly. It seems to sort for the first page of results, but the sort does not work across multiple page results.

Additionally, we noticed that Boolean columns in the dependent modules do not sort correctly either. For example, in the user listing, if we sort by 'Active' we would expect the inactive users to be listed first - instead the sort seems somewhat random.


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will check that.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can I reproduce this on your https://github.com/balessi75/FM.Test project?

  • User Avatar
    0
    balessi75 created

    Hi @maliming,

    You can reproduce 3 sorting issues using the https://github.com/balessi75/FM.Test project.

    1. Extended properties (mapped to EF) on ABP entities do not sort properly. You can see this by trying to sort on the "Host" column in the tenant management page
    2. Boolean properties for ABP entities do not sort properly. You can see this by sorting on the "Active" column under the User Management page.
    3. User Management's calculated "Roles" column does not have sorting enabled. If we replace/override the user management page and make the column sortable, we receive the following exception...

    No property or field 'RoleNames' exists in type 'IdentityUser' (at index 24)

               UserManagementTableColumns
                .AddRange(new TableColumn[]
                {
                       ...
                            new TableColumn {
                                Title = L["Roles"],
                                Data = nameof(IdentityUserDto.RoleNames),
                                ValueConverter = (data) =>
                                {
                                    var roleNames = (data as IdentityUserDto)?.RoleNames;
                                    return roleNames == null ? string.Empty : string.Join(", ", roleNames);
                                },
                                Sortable = true
                            }
                        ...
    

    Is sorting with paged result sets supported with this kind of calculated column?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok, I will try to test it.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    https://github.com/abpframework/abp/issues/15910

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38