Operations Class
针对过滤器条件字符串的条件过滤操作;预设了基础操作;另外可以通过st.extendOperation(operation,checkFn)
进行扩展和重写
Defined in:
Module: FilterBuilder
src\dataManager\filterBuilder.js:419
Methods
extendOperation
extendOperation
(
-
operation
-
checkFn
)
扩展判断操作符,如:'='比较操作符,name = @name
Parameters:
name | type | flag | description |
---|---|---|---|
operation
| String | 操作名称 | |
checkFn
| Function | 判断方法 |
Example:
//添加大于操作符'>'
st.extendOperation('>',function(data, param) {
//data为数据,param为条件参数
return data > param;
});
Properties
!
Operation
非判断,在判断操作符之前加入!,则将判断结果取非
Example:
//查询name不等于'roy'的数据
var filter = "name != 'roy'"
<
Operation
小于判断
<=
Operation
小于等于判断
=
Operation
等于判断
>
Operation
大于判断
>=
Operation
大于等于判断
endOf
Operation
以参数为结尾
Example:
//匹配以'es'结尾的name
var filter = "name endOf 'es'";
in
Operation
参数中包含数据
like
Operation
数据中包含参数
startOf
Operation
以参数为开头