concept ComboBox in category ext js

This is an excerpt from Manning's book Ext JS in Action, Second Edition.
The ComboBox is easily the most complex and configurable form input field. It can mimic traditional option drop-down boxes or can be configured to use remote datasets via the data store. It can be configured to autocomplete text (known as type-ahead) entered by the user and to perform remote or local filtering of data. It can also be configured to use your own instance of an Ext JS XTemplate to display a custom list in the drop-down area, known as the bound list. Figure 1.13 shows an example of a custom ComboBox in action, being used to search the Ext JS forums..
Figure 1.13. A custom ComboBox, which includes an integrated paging toolbar, as shown in the downloadable Ext JS examples
![]()
The ComboBox here shows information like the post title, date, and author, and a snippet of the post in the list box. Because some of the dataset ranges are so large, it’s configured to use a paging toolbar, allowing users to page through the resulting data. Because the ComboBox is so configurable, you could also include image references to the resulting dataset, which can be applied to the resulting rendered data.
Because there are so many things to cover with input fields, this chapter will follow a cookbook style, where we walk you through the many Ext JS input fields such as the generic text field, text area, and number fields. We’ll take a good look at the ComboBox, an input field that merges a simple text field with a custom drop-down list and that’s arguably the most complex input field to implement in the framework. Once you get a solid grasp on these input fields, we’ll tie things together by implementing and discussing the FormPanel class, where you’ll learn the ins and outs of saving and loading data.
The cleverly named ComboBox field is like the Swiss Army knife of text input fields. It’s a combination of a general text input field and a general drop-down box to give you a flexible and highly configurable combination input field. The ComboBox has the ability to automatically complete text entries (known as type-ahead) in the text input area, and, coupled with a remote data store, it can work with the server side to filter results. If the ComboBox is performing a remote request against a large dataset, you can enable result paging by setting the pageSize property. Figure 6.4 illustrates the anatomy of a remote-loading and -paging ComboBox.
Before we look at how the ComboBox works, let’s explore how to construct one. Because you’re familiar with how to lay out child items, this is an excellent opportunity to use your new recently gained knowledge. So moving forward, when we discuss items that don’t contain children, such as fields, we’ll leave it up to you to build a container. You can use the form panel from listing 6.2.