Search 过滤网格-ExtJS
我试图根据用户在文本字段中搜索的内容搜索特定字段。例如:Search 过滤网格-ExtJS,search,extjs,filter,grid,Search,Extjs,Filter,Grid,我试图根据用户在文本字段中搜索的内容搜索特定字段。例如: items: [ { xtype: 'panel', padding: 5, height: 500, width: '35%', items: [ { xtype: 'textfield', padding: 5, region: 'west', fieldLabel: 'Criteria 1', itemId: 'crit
items: [
{ xtype: 'panel', padding: 5, height: 500, width: '35%',
items: [
{ xtype: 'textfield', padding: 5, region: 'west', fieldLabel: 'Criteria 1', itemId: 'criteria_1' }, ...
下面是我的视图类中的代码:
store.filter('KBE_ID', '#criteria_1');
我想返回使用my textfield值的筛选搜索。这可以通过给它一个itemId来完成吗?使用
itemId
获取对字段的引用,然后使用getValue()
进行筛选:
有道理,我只是对myPanel的引用感到困惑。
myPanel
是对搜索字段的任何父面板的引用。在没有看到代码的完整上下文的情况下,我无法确切地告诉您如何操作,但是x.down(“#criteria_1”)
将适用于组件层次结构中作为criteria_1
父级的任何x
。
var searchField = myPanel.down('#criteria_1');
store.filter('KBE_ID', searchField.getValue());