【问题标题】:What event is called when we click the Filter button in Kendo Grid当我们单击 Kendo Grid 中的 Filter 按钮时会调用什么事件
【发布时间】:2018-08-29 11:15:52
【问题描述】:

我的 ASP.NET MVC Web 应用程序中有一个 Kendo Grid。每列都使用过滤器。我需要使用从过滤器中选择的值并将其保存以维护日志。单击过滤器按钮后如何访问该值。我的意思是我需要在单击“过滤器”按钮时使用剑道网格的客户端事件或任何其他方式保存值“LPG”。Please find the screenshot here.

【问题讨论】:

  • 到目前为止,您有尝试过的东西吗?如果您能为我们提供MCVE,那就太好了!

标签: kendo-ui kendo-grid kendo-asp.net-mvc kendo-ui-mvc


【解决方案1】:

它是网格上的过滤器事件。 API 文档在这里:https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/filter

如果您为此运行 dojo 并打开浏览器工具,您可以准确地看到需要写入控制台的内容。 Telerik 给出的示例采用 jquery 插件语法。如果您使用 MVC 包装器来声明网格,那么在网格声明中会是这样的:

.Events(events => events
        .Filter("onFiltering")
)

还有一个类似这样的处理程序:

<script type="text/javascript">

function onFiltering(e) {
    if (e.filter == null) {
        console.log("filter has been cleared");
    } else {
        console.log(e.filter.logic);
        console.log(e.filter.filters[0].field);
        console.log(e.filter.filters[0].operator);
        console.log(e.filter.filters[0].value);
    }
}

</script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多