PDA

View Full Version : TextField Event



Flcn
18 Jun 2010, 4:33 AM
Hello.
I have a grid with toolbar.
in toolbar i have textfield.

How to add keyup listner to this TextField ?

or if it possible:

When you types in this text field. grid is filtering. if row in some colomn (name for example) haven't this part of text(typed in tf) they hide...


sorry for bad english.

Condor
18 Jun 2010, 4:52 AM
{
xtype: 'textfield',
enableKeyEvents: true,
listeners: {
keyup: function(f){
Ext.getCmp('mygrid').getStore().filter('myfield', f.getValue());
}
}
}

Flcn
18 Jun 2010, 5:13 AM
Great thanks Condor.
How i can do that search string (from textfield) can equals to any part of string from grid, not only from beginings?

(and i don't find .filter in API. There i can find them? )

Condor
18 Jun 2010, 5:42 AM
Look in the API at Ext.data.Store.filter()