PDA

View Full Version : Grid filter in column header



neosky
22 Jun 2015, 6:50 AM
i am want make filter for grid in each columns. That my grid with filter, but when i am enter text to filter all data from grid remove and grid be empty. I am want correct worked filter.


Ext.selection.RowModel.override({
getSelectedIndex: function() {
return this.getStore().indexOf((this.getSelection())[0]); }
});
Ext.define('TPL.view.book', {
extend: 'Ext.grid.Panel',
alias: 'widget.book',
title: 'Book Price',
stripeRows: true,
filterable: true,
//There i am define filter:
requires: [ 'Ext.ux.grid.FiltersFeature'],
features: [{
ftype: 'filtersex',
encode: false,
local: true,
menuFilterText: 'Filter'}],
config: {
peopleId: null},
constructor: function(config)
{
this.initConfig(config);
this.callParent(arguments);},
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})],
//In all columns in header i am add filter
this.columns = [
{header: 'book',
dataIndex: 'book',
flex: 1,
hidden: true,
filter: {
type: 'string'},
},
{
header: 'price', flex: 1, dataIndex: 'price',
filter: { type: 'string'},
},
];}
});

Gary Schlosberg
22 Jun 2015, 11:21 AM
Are you talking about this kind of filter?
http://docs.sencha.com/extjs/4.2.1/#!/example/grid-filtering/grid-filter-local.html