Filter KendoUI在筛选器事件上更改筛选器

Filter KendoUI在筛选器事件上更改筛选器,filter,kendo-ui,kendo-asp.net-mvc,Filter,Kendo Ui,Kendo Asp.net Mvc,我正在尝试在网格上实现级联过滤器(子过滤器应根据父选择显示特定数据)。我使用自定义模板实现了这一点。现在,当父过滤器被移除时,我必须移除子过滤器。(父字段和子字段位于同一网格上) 是否有方法影响筛选事件上其他字段的筛选 function onFiltering(args) { //var datasource = args.sender.dataSource; //=> filter is undefined var datasource = $(args.sender).

我正在尝试在网格上实现级联过滤器(子过滤器应根据父选择显示特定数据)。我使用自定义模板实现了这一点。现在,当父过滤器被移除时,我必须移除子过滤器。(父字段和子字段位于同一网格上)

是否有方法影响筛选事件上其他字段的筛选

function onFiltering(args) {
    //var datasource = args.sender.dataSource; //=> filter is undefined
    var datasource = $(args.sender).data("kendoGrid").dataSource; // => could not found the kendo widget
    var filters = datasource.filter();
    datasource.filter([]);

    // never manage to get to this part of code
    // determine if the parent filter exist in the filters
    var result = ...

    if (result.length == 0) {
        // determine the position of the child filter in the filters
        indexes = ...
        // remove the child filter
        filters = filters.splice(indexes[0], 1);
    }
    // set the new filter
    datasource.filter(filters);
}

我尝试了一些方法来访问数据源和/或筛选器,但似乎都不起作用。

我有点困惑,您想知道如何将多个筛选器应用于同一字段吗?下面是一个示例,我想在清除另一个筛选器时删除该筛选器。在您的示例中,当船舶名称过滤器被删除时,船舶城市也应该被删除。但是我需要一种一致的方式,这样3个字段就可以被级联清除?在这里提供一个小标题肯定会有帮助(至少可以为您的问题提供更多的上下文)。