API
Component

SmartFilter ($UI/system/components/justep/smartFilter/smartFilter)

使用范围:UI2

Contents

component SmartFilter ($UI/system/components/justep/smartFilter/smartFilter) extends ViewComponent

智能过滤组件

	
		SmartFilter组件通过简单的属性设置就可以给数据增加动态过滤的能力,关键属性有:
			filterData: 过滤数据
			filterCols: 过滤列
		SmartFilter会将用户输入的字符串构造成LIKE过滤条件,自动设置到数据上,同时如果autoRefresh属性为true则自动刷新数据
	

Constructor Top

  SmartFilter ()
  SmartFilter ( options)

Properties Top

observable searchText

搜索文字,可以通过set和get方法存取。

Attributes Top

boolean autoRefresh

是否自动刷新 - 默认是true,用户输入后不仅设置数据的过滤条件,同时自动刷新数据。

string autoRefreshMode

自动刷新模式 - input:输入停顿500毫秒后刷新,change:焦点移出或回车确认后刷新。

boolean caseSensitive

是否大小写敏感 - true:敏感;false:不敏感,默认是false。注意:设置为true时不一定就真的大小写敏感,因为大多数数据库默认LIKE是大小写不敏感的。

string filterCols

过滤列,多个用逗号分隔

string filterData

过滤数据,必须是bizData

string xid

组件标识

Methods Top

void clear ()
void filter ()
Data getFilterData ()
string getFilterFlag ()
string getFilterStr ()
void refresh ()

Operations Top

clearFilter ()

Events Top

void onFilter (ViewEvent event)

Constructor details Top

public SmartFilter ()

智能过滤组件

	
		SmartFilter组件通过简单的属性设置就可以给数据增加动态过滤的能力,关键属性有:
			filterData: 过滤数据
			filterCols: 过滤列
		SmartFilter会将用户输入的字符串构造成LIKE过滤条件,自动设置到数据上,同时如果autoRefresh属性为true则自动刷新数据
	

public SmartFilter ( options)

构造函数

Inherited from ViewComponent

	
		参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
	 

Parameters

options

参数选项

Properties Detail Top

public observable searchText

搜索文字,可以通过set和get方法存取。

Attributes Detail Top

public boolean autoRefresh

是否自动刷新 - 默认是true,用户输入后不仅设置数据的过滤条件,同时自动刷新数据。

public string autoRefreshMode

自动刷新模式 - input:输入停顿500毫秒后刷新,change:焦点移出或回车确认后刷新。

public boolean caseSensitive

是否大小写敏感 - true:敏感;false:不敏感,默认是false。注意:设置为true时不一定就真的大小写敏感,因为大多数数据库默认LIKE是大小写不敏感的。

public string filterCols

过滤列,多个用逗号分隔

public string filterData

过滤数据,必须是bizData

public string xid

组件标识

Methods Detail Top

public void clear ()

清除过滤条件

Return Value

void

public void filter ()

设置数据的过滤条件,如果“自动刷新”则刷新数据;开发者可以通过onFilter事件接管。

Return Value

void

public Data getFilterData ()

获取过滤数据集对象

Return Value

Data

public string getFilterFlag ()

获取过滤条件标识

Return Value

string

public string getFilterStr ()

获取过滤条件字符串

Return Value

string

public void refresh ()

刷新过滤条件

Return Value

void

Operations Detail Top

public clearFilter ()

清除过滤条件

Events Detail Top

public void onFilter (ViewEvent event)

过滤事件

Parameters

ViewEvent event


结构如下:

{ "source" : 组件的js对象 "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明 }

Return Value

void