Declined
Last Updated: 04 Feb 2025 08:01 by ADMIN
Garrett
Created on: 24 Jan 2025 19:57
Category: UI for ASP.NET Core
Type: Bug Report
1
Grid row filter not recognizing data type of nested properties in non-flat schema

In this screenshot, End Date and Subm Is Open are "nested" properties, and Prod Date and Is LatestVersion are *not* nested.  The row filter functionality is not displaying the correct row filter widget.

Here's a data sample:

{

            "SubmissionVersionId": 1020,

            "ReleaseId": 2008,

            "SubmissionVersionNumber": 6,

            "IsLatestVersion": true,

            "SetId": "E2410-1f",

            "EioSubmissionId": null,

            "SubmissionName": null,

            "RequestDate": null,

            "SubmissionDate": null,

            "WitsDate": null,

            "ProdDate": null,

            "OnHoldReason": null,

            "IsSubmitted": true,

            "Created": "2024-12-20T14:39:51-08:00",

            "RowVersion": "AAAAAAAAn28=",

            "Release": {

                "ReleaseId": 2008,

                "UnversionedSetId": "E2410-1",

                "StatusId": 1,

                "ReleaseTypeId": 1,

                "ReleasePriorityId": 3,

                "EncDate": "2025-01-08",

                "KphcSuite": null,

                "SnowReq": null,

                "SnowRitm": null,

                "Created": "2024-12-17T11:20:02-08:00",

                "ReleasePriority": {

                    "ReleasePriorityId": 3,

                    "ReleasePriorityName": "Routine",

                    "ReleasePriorityAbbreviation": "ROU"

                },

                "ReleaseType": {

                    "ReleaseTypeId": 1,

                    "ReleaseTypeName": "New"

                },

                "Status": {

                    "ReleaseStatusId": 1,

                    "ReleaseStatusName": "In Progress",

                    "IsOpen": true

                }

            }

        }

 

Here is the schema definition.

 

        .Schema(s => {
            s.Model(model =>
            {
                model.Id(p => p.SubmissionVersionId);
                model.Field(p => p.SubmissionVersionId).Editable(false);
                model.Field(p => p.ReleaseId).Editable(false);
                model.Field(p => p.SubmissionVersionNumber).Editable(false);
                model.Field(p => p.IsLatestVersion).Editable(false);
                model.Field(p => p.EioSubmissionId).Editable(false);
                model.Field(p => p.SubmissionName);
                model.Field(nameof(SubmissionVersion.RequestDate), typeof(DateOnly)).DefaultValue(null);
                model.Field(nameof(SubmissionVersion.SubmissionDate), typeof(DateOnly)).DefaultValue(null);
                model.Field(nameof(SubmissionVersion.WitsDate), typeof(DateOnly)).DefaultValue(null);
                model.Field(nameof(SubmissionVersion.ProdDate), typeof(DateOnly)).DefaultValue(null);
                model.Field(nameof(SubmissionVersion.IsSubmitted), typeof(bool)).DefaultValue(false);
                // Release fields
                model.Field(nameof(Release.UnversionedSetId), typeof(string)).Editable(false);
                model.Field(nameof(Release.EncDate), typeof(DateOnly));
                model.Field(nameof(Release.SnowReq), typeof(string));
                model.Field(nameof(Release.KphcSuite), typeof(string));
                model.Field(nameof(Release.SnowRitm), typeof(string));
                // ReleaseStatus fields
                model.Field(nameof(ReleaseStatus.IsOpen), typeof(bool)).Editable(false);
            });
        })

I've attached the full cshtml file.

Attached Files:
4 comments
ADMIN
Alexander
Posted on: 04 Feb 2025 08:01

Hi Garrett,

Sweet, happy to help :)

Kind Regards,
Alexander
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Garrett
Posted on: 04 Feb 2025 00:23

Hi Alexander,  Thanks for the guidance.  I can confirm that this seems to have worked for both fields.  Actually I did encounter another issue but I figured out I needed to fully qualify the field in the column template, and this resolved the issue.

"#= GridHelper.convertBool(Release.Status.IsOpen) #"

Thanks again,

Garrett

ADMIN
Alexander
Posted on: 03 Feb 2025 16:23

Hi Garret,

Thank you for your patience.

After further digging, it appears that the sole reason for the reported behavior has to do with the schema annotation for the nested fields.

Generally speaking, the DataSource supports flat data as it strives to follow conventional normalization principles such as:

  • Atomicity
  • Data Integrity
  • Functional dependencies

To some extent, it aims to further reduce data redundancy and eliminate undesirable characteristics. Taking this into consideration, the DataSource is not that "smart enough" to detect nested fields. through the "nameof(xxxx.xxxx)" method. 

That it said, it is mandatory to specify the full name of the field:

.Schema(s =>
{
    s.Data("Data");
    s.Total("Total");
    s.Model(model =>
    {
        model.Field("Release.EncDate", typeof(DateOnly));
        model.Field("Release.Status.IsOpen", typeof(bool));
        ...
    });
})

This should then aid the filter row functionality into serializing the appropriate editor:

Please let me know if this helps.

Kind Regards,
Alexander
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Alexander
Posted on: 31 Jan 2025 14:04

Hi Garrett,

Thank you for reaching out and for sharing the utilized configuration on your front.

Since the attached view is of fairly large proportions with additional client-side surgical interventions, I would need some additional time to assess the validity of this behavior and perform some additional tests locally.

I will get back you once I have a breakthrough with the case. Thank you for your patience in advance.

Kind Regards,
Alexander
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.