首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JSGrid没有显示过滤器输入字段

JSGrid没有显示过滤器输入字段
EN

Stack Overflow用户
提问于 2019-05-17 20:08:56
回答 2查看 1.5K关注 0票数 1

我希望按预期的方式在标题行单元格下创建和显示输入过滤器字段。

在我的MVC解决方案中,我的JSGrid通过AJAX/JSON/GET进行填充。当我添加"filtering:true“时,我能够对loadData、javascript等进行排序,在标题行和表主体行之间生成带有单元格的行,但是输入字段不存在。我尝试过包括不同的CSS、JQuery和JS库,并试图模仿许多演示程序和示例。

代码语言:javascript
复制
function RenderImportHistory() {
    $("#jsGrid_ImportHistory").jsGrid({
        width: "100%",
        height: "572px",
        pageSize: 10,
        pageButtonCount: 5,

        filtering: true,
        editing: true,
        sorting: true,
        paging: true,
        autoload: true,

        loadIndication: true,
        loadIndicationDelay: 500,
        loadMessage: "Getting Import History ...",

        controller: {
            loadData: function (filter) {
                var d = $.Deferred();
                $.ajax({
                    url: "@Url.Action("GetImportHistory", "SCAL", new { Area = "Admin" })",
                    dataType: "json",
                    type: "GET"
                }).done(function(result) {
                    /*result = $.grep(result, function(item) {
                        return item.patientId === filter.patientId
                           && item.patientName === filter.patientName
                           && item.genderId === filter.genderId
                           && item.mobile === filter.mobile;

                    }); */
                    d.resolve(result);
                });
                return d.promise();
            }
        },
        fields: [
            { name: "ID", type: "Number", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 11, sorter:"number" },
            { name: "ImportSched_ID", type: "Number", title: "Schedule", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 27, sorter:"number" },
            { name: "Created", type: "Text", title: "Started", css: "jsGrid_Body", headercss: "jsGrid_Head", itemTemplate: function (value) { return FormatDateTime(value); } },
            { name: "Completed", type: "Text", title: "Ended", css: "jsGrid_Body", headercss: "jsGrid_Head", itemTemplate: function (value) { return FormatDateTime(value); } },
            { name: "NumOfClaims", type: "Number", title: "Claims", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 21, sorter: "number", itemTemplate: function (value) { return FormatCounts(value); } },
            { name: "NumOfRecords", type: "Number", title: "Rows", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 21, sorter: "number", itemTemplate: function (value) { return FormatCounts(value); } },
            { name: "TimeToRead_Seconds", type: "Number", title: "Read", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 21, sorter: "number", itemTemplate: function (value) { return FormatDuration(value); } },
            { name: "TimeToWrite_Seconds", type: "Number", title: "Wrote", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 21, sorter: "number", itemTemplate: function (value) { return FormatDuration(value); } }
        ]
    });
}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-05-17 21:26:15

好吧,其实很简单,也很傻。它是如此的愚蠢和简单,以至于很容易被忽略。将字段中的类型声明更改为所有小写。

类型:“数字”>>类型:“数字”

类型:"Text“>>类型:"text”

开发人员应该对大小写不敏感,但懒散的开发人员.

票数 0
EN

Stack Overflow用户

发布于 2020-07-28 13:42:45

也许这个话题已经开放了很长时间。但是我遇到了同样的问题,并且使用了标题:真正的属性为我工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56192931

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档