ftype : 'groupingsummary',
groupHeaderTpl : '{name}',
hideGroupedHeader : false,
enableGroupingMenu : false
}, {
ftype: 'filters',
local: true
}, {
ftype: 'summary',
dock: 'bottom'
}],
columns:[ {
text: 'Name (Filter)',
sortable: true,
dataIndex: 'name',
groupable: false,
width: 120,
locked: true,
renderer: function(v, cellValues, rec) {
return rec.get('forename') + ' ' + rec.get('surname')
},
editor: {
xtype: 'textfield'
},
items : {
xtype: 'textfield',
flex : 1,
margin: 2,
enableKeyEvents: true,
listeners: {
keyup: function() {
var store = this.up('tablepanel').store
store.clearFilter()
if (this.value) {
store.filter({
property : 'name',
value : this.value,
anyMatch : true,
caseSensitive : false
})
}
},
buffer: 500
}
}
}]
官方的例子。
大致思路,你参考下:{
text: '搜索', iconCls:'icon-zoom',
handler: function(btn){ //点击搜索时执行函数
var type= Ext.getCmp('combo_id').getValue() //关键字类型
var value= Ext.getCmp('textfield_id').getValue() //搜索值
var gridSearch = {keyType:type, searchStr:value} //组合成一个对象去传递
var store = Ext.getCmp('grid_id').getStore() //获取grid的store
store.baseParams = {}//绑定参数(在store访问的那个路由中去接收并处理)
store.baseParams['gridSearch'] = Ext.encode(gridSearch)
store.lastOptions.params[store.paramNames.start] = 0
store.removeAll()
store.commitChanges()
store.reload()
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)