[英]Kendo Grid Filter customaization
I have to customize the kendo grid filter event.我必须自定义剑道网格过滤器事件。 On applying filter instead of filtering the records based on the available records on the grid i need to requery along with filters.
在应用过滤器而不是根据网格上的可用记录过滤记录时,我需要与过滤器一起重新查询。
ie: IE:
Onfilter
{
prevent filtering on existing data()
requery from db and apply filter on that data()
}
so i have coded like below.(in document ready)所以我编码如下。(准备好文件)
(document).ready(function (){
grid.bind("filter", function (e) {
if ((e.filter == null) ) {
mymanualretrieve();
}
if (e.filter!=null) {
tempFilter = e.filter.filters;
}
//i don't want the default filtering. to prevent that i am clearing it out
e.filter = grid.dataSource.filter({});}
I have one dropdown where i should call retrieve again with the filters applied.so i am trying like below in change event of drop down.我有一个下拉列表,我应该在应用过滤器的情况下再次调用检索。所以我正在尝试如下更改下拉列表事件。
if (tempFilter != null && tempFilter != undefined) {
grid.dataSource.filter({ tempFilter });
mymanualretrieve();
tempFilter = grid.dataSource.filter().filters;
//I need to prevent default filtering here as well, but on applying the below code, my manual retrieve is not queried based on filters
grid.dataSource.filter({});
After this changes dcument.ready also doesn't get hit on filtering在此更改后 dcument.ready 也不会在过滤时受到影响
custom filter options for every column: asp.net MVC
每列的自定义过滤器选项:asp.net MVC
columns.Bound(c => c.columnName).Format("{0}%").Filterable(
ftb=>ftb.Cell(cell=>cell.ShowOperators(true))
.Extra(false)
.Operators(op=>op.ForNumber(fn=>fn.Clear()
.IsEqualTo(CommonResource.GridFilter_IsEqualTo)
)))
.Title("Column Name");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.