Like most things in Ext, a tool bar can accept just about any Ext component. Naturally, form fields and combo boxes are very useful items to have on a toolbar.
{ xtype: 'textfield' }
In the same way as we created form fields in the last chapter, we have added the form fields to the items array, which will place the form fields within the toolbar. Now let's make the form field do something useful, by having it perform the same functionality as our help menu, but in a more dynamic way.
{
xtype: 'textfield',
listeners: {
specialkey: Movies.doSearch
}
}
This listener is added directly to the form field's config. For this, we are using a specialkey
listener, which we used in the previous chapter. This is the listener that is used to capture edit keystrokes, such as Enter and Delete among others. The handler
function will be added to our small Movies
class created earlier:
doSearch : function(frm,evt){ if (evt.getKey() == evt.ENTER) { Movies...