我extjs4工作,滤波器同一列的ExtJS的4
我想在我的网格中添加一个过滤器(由行或列的数据过滤器)
目前我可以DISPLY我的数据网格从数据库中检索,
这是我的代码:
Ext.define('DataEmployeeList', {
extend: 'Ext.data.Model',
fields: [
{name: 'id_emplyee', type: 'string'},
{name: 'firstname', type: 'string'},
{name: 'lastname', type: 'string'} ,
{name: 'work', type: 'string'}
]
});
var DataEmployeeListGridStore = Ext.create('Ext.data.Store', {
model: 'DataEmployeeList'
});
var DataEmployeeListGrid1 = Ext.create('Ext.grid.Panel', {
id:'DataEmployeeListGrid',
store: DataEmployeeListGridStore,
collapsible:true,
columns:
[
{xtype: 'checkcolumn', header:'display data', dataIndex: 'checked', width: 60,listeners:{'checkchange': requestGridSelectionChanged}},
{text: 'رق', flex: 1, sortable: true, hidden:true, dataIndex: 'id_employee'},
{text: 'firsname', flex: 1, sortable: true, dataIndex: 'firstname'},
{text: 'lastname', flex: 1, sortable: true, dataIndex: 'lastname'},
{text: 'work', flex: 1, sortable: true, dataIndex: 'work'}
],
columnLines: true,
anchor: '100%',
height: 250,
frame: true,
margin: '0 5 5 5',
});
function fillEmployeeList()
{
employeeService.findAllEmployee({
callback:function(list)
{
DataEmployeeListGridStore.removeAll();
if (list!=null)
{
for(var i=0; i<list.length; i++)
{
var id=list[i].idEmployee;
var firstN=list[i].firstname;
var lastN=list[i].lastname;
var workEmp= list[i].work;
DataEmployeeListGridStore.add({id_employee:id, firstname:firstN, lastname :lastN, workEmp : work});
}
}
}
});
}
Ext.onReady(function() {
fillEmployeeList();
}
我employeeService.java:
public class employeesService{
public List<employees> getEmployeesListByLibelle() {
// TODO Auto-generated method stub
Query query = getSession().createQuery("FROM employees");
List result = query.list();
if(result.size()!=0 && result !=null)
return result;
else
return null;
}
}
,因为我已经说过,我可以用正确的数据显示我的drid,
现在我想以输入相同的数据筛选根据文本字段
输入的数据我的网格中添加我的网格上方一个文本框我觉得ExtJS的提供做网格过滤器的可能性,但我不能找到在这方面的任何解决方案
我的目标,如果有可能,在ExtJS的插件来选择文本框或其他composant相关过滤器来选择我们想要做的过滤器列,并输入相同的数据在文本文件到f此款过滤器