这里主要展示如何使用搜索的关键字过滤DataGrid的行。其实也不是很难,因为DataGrid使用dataProvier可以是 ArrayCollection,并且ArrayCollection本身就有过滤的功能即使用变量filterFunction.所以基本上,你的 DataGrid和dataProvider像如下的定义:
public function filterResults():void
{
dpRows.filterFunction = _sortRows;
dpRows.refresh();
}
private function _sortRows(item:Object):Boolean
{
var col:String = cmbCol.selectedItem.data as String;
var key:String = keyword.text;
key = key.toLowerCase();
if (key != "")
{
if (col != "any")
{
var value:String = item[col];
value = value.toLowerCase();
if (value.indexOf(key) >= 0)
{
return true;
}
} else {
for (var o:String in item)
{
value = item[o];
value = value.toLowerCase();
if (value.indexOf(key) >= 0)
{
return true;
}
}
}
} else {
return true;
}
return false;
}
分享到:
相关推荐
NULL 博文链接:https://queue19.iteye.com/blog/373457
过滤DataGrid显示的数据 过滤DataGrid显示的数据 过滤DataGrid显示的数据 过滤DataGrid显示的数据
EasyUI DataGrid过滤用法实例
在FLEX4中开发带有过滤功能的DATAGRID组件
DataGrid实现数据过滤。 输入关键字,对DataGrid中的数据进行筛选过滤
在easy ui datagrid 列表基础上实现行过滤[行模糊查询],注:数据库远程查询
利用微软的MVVM开发模式,方便高效的使用DataGrid控件实现功能。
VC使用ADO Data和DataGrid控件实现遍历、修改、删除、添加 所有数据库都大同小异。
WPF之DataGrid使用示例WPF之DataGrid使用示例WPF之DataGrid使用示例
c# DATAGRID使用方法c# DATAGRID使用方法c# DATAGRID使用方法c# DATAGRID使用方法
DataGrid条目过滤和Tree 所有节点过滤的例子 Flash Builder 4工程,可直接导入
DataGrid使用心得DataGrid使用心得DataGrid使用心得DataGrid使用心得DataGrid使用心得DataGrid使用心得
我自己将EASYUI官网里datagrid中的编辑表格和过滤表格两个demo合成的一个demo,供大家参考使用,下载解压后直接打开html即可,版本是easyui1.5
摘要:VB源码,数据库应用,Datagrid,ADO VB使用ADO控件和DATAGRID数据网络显示数据的实例,如果你还不知道如何使用VB连接或读取数据库,你正好可以参考本程序,你还可以学习到DataGrid数据显示控件的使用。
对MFC中的DataGrid控件的用法进行了一些总结
easyui datagrid 多条件筛选 可复选 过滤 例如过滤200-300 500-600 类似淘宝筛选 但允许复选
C#160使用对象ArrayList填充DataGrid 源代码
使用radion button选择datagrid的行.doc
jeasyui-datagrid-datagrid 开发参考