我试图在我的页面上创建一个 Kendo Angular 网格控件,并在特定列上使用复选框列表过滤器(列配置可过滤:{multi:true} 没有帮助。),并具有该列的不同值。我需要实现的自定义过滤器是一个复选框列表,如下面的线框所示(现在只有第一列和过滤器是焦点)。
列表中黄色突出显示的项目是过滤器项目。我没有看到任何开箱即用的功能来启用此功能。我已经尝试使用如下所示的 Kendo 多选控件来实现此目的。
$scope.registryTypeFilter = function (element) {
var menu = $(element).parent();
menu.find(".k-filter-help-text").text("Show records for people working as:");
menu.find("[data-role=dropdownlist]").remove();
var multiSelect = element.kendoMultiSelect({
dataSource: _.uniq(_.pluck($scope.automationQueueItems.data(), 'RegistryType')),
itemTemplate: "<input type='checkbox' />(<label ng-bind='\'data.RegistryType\''></label>)",
tagTemplate:"$scope.dataItem"
}).data("kendoMultiSelect");
menu.find("[type=submit]").on("click", { widget: multiSelect }, filterByRegistryTypeAutomationQueue);
}
但是多选控制并不是所需要的。有人尝试过同样的事情吗?
最佳答案
我使用的是旧版本 2014.x.x。新版本2015.x.x支持filterable:{multi:true}。升级到最新版本。这就是我解决问题的方法。
关于javascript - Kendo UI Angular Grid 复选框列表自定义过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34408570/