PDA

View Full Version : Need urgent help:Column Header Filters



sravaniv
23 Apr 2012, 12:31 PM
Hi guys,

I have implemented column header filters for my grid, but the data is filtered only if I enter the start of the string. i.e. 'Smith' would result only if I type 'Sm' but not 'ith'.

In short , I need a filter which would take any part of the string and still gives me the result.

I have to handle this at server side.At server side, though Im able to get the records which match a part of the string, when I display it in my grid , the data is again filtered to match the start of the string.And thus I dont get the expected result.

Can anybody please help? Its very very urgent.:((

sravaniv
23 Apr 2012, 8:31 PM
Anybody in here ??

Romick
26 Apr 2012, 6:16 AM
Why not you gave some peace of code?


Ext.onReady(function() {

var simpleCombo = Ext.create('Ext.form.field.ComboBox', {
fieldLabel: 'Select a single state',
displayField: 'name',
valueField: 'abbr',
width: 320,
labelWidth: 130,
queryMode: 'local',
typeAhead: true,
minChars: 2,
name: 'agentDownline',
store: new Ext.data.SimpleStore({
fields: ['abbr', 'name', 'slogan'],
data: [
['VA', 'Virginia', 'Mother of States'],
['WA', 'Washington', 'Green Tree State'],
['WV', 'West Virginia', 'Mountain State'],
['WI', 'Wisconsin', 'America\'s Dairyland'],
['WY', 'Wyoming', 'Like No Place on Earth']
]
}),
listeners: {
buffer: 50,
change: function() {
var store = this.store;
//store.suspendEvents();
store.clearFilter();
//store.resumeEvents();
store.filter({
property: 'name',
anyMatch: true,//this is the key of your problem!!!
value : this.getValue()
});
}
}
});

Ext.create("Ext.Window", {
items: simpleCombo
}).show();

Also I dont anderstand if filtering is made on server side why do you need filter it localy?
Also I would recomend you read this helpfull article about combobox. http://skirtlesden.com/articles/extjs-comboboxes-part-1.
Hope this help you.