O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rendering the results in a combobox

By default, the ComboBox component provides a neatly presented list of options for a user to choose from based on the value in the displayField giving the same experience as the HTML <select> tag.

However, there are occasions when we may wish to present more to the user or customize the styling of the results. This recipe aims to demonstrate how to tackle this problem and produce a combobox with a customized list of results.

How to do it...

  1. Define an Issue Model:
    Ext.define('Issue', {
        extend: 'Ext.data.Model',
        fields: ['id', 'raisedBy', 'title', 'body', 'status']
    });
  2. Create a store and add some data for local loading:
    var store = Ext.create('Ext.data.Store', { model: 'Issue', data: [{ id: 1, raisedBy: 'Joe', title: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required