store内数据的筛选

extjs对存储在store是能进行筛选的。

store.filter( String|Array field, String/RegExp value, [Boolean anyMatch], [Boolean caseSensitive], Boolean exactMatch )
store.filter(
property     : 'name',
value        : 'Ed',
anyMatch     : true, //optional, defaults to true
caseSensitive: true  //optional, defaults to true
);

property:是你记录里面的‘字段名称’

value:要查询的值

anyMatch:当为true是匹配任意位置,不是从头开始匹配。

caseSensitive:是否区分大小写,true为区分在大小写

exactMatch:true为强制精确匹配 默认为false.如果anyMatch 为 true,该参数忽略(我没有用过,只是直译)

但是有个问题,这个方法只能筛选当前页。就是说你分页了,如果总共100条数据,而第一页只有20条,就只能从这20条里面筛选。

 

posted @ 2012-06-25 16:15  yanqing07  阅读(306)  评论(0)    收藏  举报