kendo ui网格过滤器空

 天天写程序 发布于 2023-02-09 09:21

我正在使用Kendo UI网格(而不是MVC),我正在尝试启用过滤.我只是使用默认的过滤(Filtering: true),我得到空的下拉列表.我过去曾经使用过它,我认为默认包括Starts with和之类的东西Is equal to.

这是我的网格代码:

$("#LogGrid2").kendoGrid({
    dataSource: logGridDataSource,
    columns: [{
        field: "CreateTime",
        headerAttributes: { style: "font-weight: bold; width: 10%;" },
        title: "Log Time",
        template: '#= kendo.toString(CreateTime, "MM/dd/yyyy hh:mm:ss") #',
        editable: false,
        attributes: { style: "width: 10%;" }
    }, {
        field: "LookupName",
        headerAttributes: { style: "font-weight: bold; width: 15%;" },
        title: "Lookup Value",
        editable: false,
        attributes: { style: "width: 15%;" }
    }, {
        field: "LogType",
        headerAttributes: { style: "font-weight: bold; width: 8%;" },
        title: "Type",
        editable: false,
        attributes: { style: "width: 8%;" }
    }, {
        field: "LogMessage",
        headerAttributes: { style: "font-weight: bold; width: 18%;" },
        title: "Message",
        editable: false,
        attributes: { style: "width: 18%;" }
    }, {
        field: "FileName",
        headerAttributes: { style: "font-weight: bold; width: 12%;" },
        title: "FileName",
        editable: false,
        attributes: { style: "width: 12%;" }
    }, {
        field: "LogNumber",
        headerAttributes: { style: "font-weight: bold; width: 7%;" },
        title: "Quantity",
        editable: false,
        attributes: { style: "width: 7%;" }
    }, {
        field: "LogExtraText",
        headerAttributes: { style: "font-weight: bold; width: 15%;" },
        title: "Opt Text One",
        editable: false,
        attributes: { style: "width: 15%;" }
    }, {
        field: "LogExtraText2",
        headerAttributes: { style: "font-weight: bold; width: 15%;" },
        title: "Opt Text Two",
        editable: false,
        attributes: { style: "width: 15%;" }
    }],
    selectable: {
        mode: "single"
    },
    sortable: true,
    groupable: true,
    scrollable: true,
    filterable: true,
    change: gridRowSelected
});

这是我的过滤器框的样子:http://i.imgur.com/EzVbjue.jpg

这是数据源的代码

var logGridDataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: baseUrl + "/Home/GetLogMessages?AppID=" + AppID + "&StartDate=" + StartDate + "&EndDate=" + EndDate + "&LookupID=" + LookupID + "&Type=" + LogType + "&LogCode=" + LogMessage,
            dataType: "json",
            cache: false
        }
    },
    schema: {
        model: {
            id: "LogID",
            fields: {
                LookupName: { type: "String" },
                CreateTime: { type: "Date" },
                LogType: { type: "String" },
                LogMessage: { type: "String" },
                LogNumber: { type: "Number" },
                FileName: { type: "String" },
                LogExtraText: { type: "String" },
                LogExtraText2: { type: "String" }
            }
        }
    }
});

我也尝试过配置可过滤的参数,但这也不起作用.在过去,我刚刚使用默认设置.这是我尝试过滤的选项.

filterable: {
    extra: false,
    operators: {
        string: {
            startswith: "Starts with",
            eq: "Is equal to",
            neq: "Is not equal to"
        }
    }
}

Robin Giltne.. 5

更改您的架构 - >模型 - >字段 - >键入小写'数字','日期'和'字符串'.

请参见示例http://jsbin.com/UBaNuBAY/1/edit

1 个回答
  • 更改您的架构 - >模型 - >字段 - >键入小写'数字','日期'和'字符串'.

    请参见示例http://jsbin.com/UBaNuBAY/1/edit

    2023-02-09 09:25 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有