[英]extjs - How to filter grid data except selected value in combo box
Ext js具有用于Grid存储的内置函数,称为filter,该函数使用组合框中的选定值对网格结果进行滤波。
我要相反。 它应该过滤除选定数据以外的网格数据。
示例:默认情况下,首先选中所有复选框。 当我取消选中任何复选框时,除选中的复选框外,应该显示网格以外的数据。
以下是我尝试过的代码,但是它确实使用选中的复选框过滤了网格。
var filterArray = [];
filterArray.push({
id: 'h2',
property: 'vehicle_trafic_light',
value: 'Y', //For Yellow-Ball
anyMatch: true,
ensitive: false
});
filterArray.push({
id: 'h2',
property: 'vehicle_trafic_light',
value: 'G', //For Green-Ball
anyMatch: true,
ensitive: false
});
store.filter(filterArray);
让我知道是否有人对此有任何建议。
您可以使用filterFn 。
您可以使用filter
filterBy接受一个函数(让调用很有趣)作为参数,并为存储中的每个记录调用函数fun。
store.fliterBy(function(record){
if(condition to include record)
return true; // record will be included
else
return false; // record will be excluded
});
并根据该记录的fun返回值过滤记录。
所以,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.