简体   繁体   English

元素没有“Serenity.EnumEditor”类型的小部件!

[英]Element has no widget of type 'Serenity.EnumEditor'!

I'm building an application for Student Information System using serenity platform.我正在使用 serenity 平台为学生信息系统构建一个应用程序。 In the dashboard I've one widget showing number of active students, when click on "More info" I want to display only the active students, I got the below error: "Element has no widget of type 'Serenity.EnumEditor'!"在仪表板中,我有一个小部件显示活动学生的数量,当单击“更多信息”时,我只想显示活动学生,出现以下错误:“元素没有类型为 'Serenity.EnumEditor' 的小部件!”

I've followed the same steps as the Northwind order example but no success:我遵循了与 Northwind 订单示例相同的步骤,但没有成功:

protected ESTS_CODEFilter: Serenity.EnumEditor;

 protected createQuickFilters(): void {
            super.createQuickFilters();
            let fld = Students.EnrollmentRow.Fields;
            this.ESTS_CODEFilter = this.findQuickFilter(Serenity.EnumEditor, fld.ESTS_CODE);
        }

public set_ESTS_CODE(value: string): void {
            this.ESTS_CODEFilter.value = value == null ? '' : value;
        }

In the StudentsIndex.cshtml page I've the below code to get the query string:在 StudentsIndex.cshtml 页面中,我使用以下代码获取查询字符串:

<script type="text/javascript">
    jQuery(function () {
        var EnrollGrid = new Portal.Students.EnrollmentGrid($('#GridDiv'), {});

        var q = Q.parseQueryString();
        console.log(q.ESTS_CODE);
        if (q.ESTS_CODE != null && q.ESTS_CODE.length) {

            EnrollGrid.set_ESTS_CODE(q.ESTS_CODE);
        }
        Q.initFullHeightGridPage($('#GridDiv'));
    });

</script>

Any idea how to define a widget of type Serenity.EnumEditor?知道如何定义 Serenity.EnumEditor 类型的小部件吗?

Thanks谢谢

Are you sure you have a EnumEditor there?您确定那里有 EnumEditor 吗? Not a LookupEditor?不是查找编辑器?

protected createQuickFilters(): void {
            super.createQuickFilters();
            let fld = Students.EnrollmentRow.Fields;

            this.ESTS_CODEFilter = this.findQuickFilter(Serenity.LookupEditor, fld.ESTS_CODE);
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM