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

Entering numbers with a Spinner field

In this recipe, we will demonstrate how to use Ext JS' number field to enter numbers. The number field is an extended Spinner field and provides enhanced functionality to the user with very simple configuration.

The Spinner allows users to increase/decrease values by using the arrow buttons, the arrow keys on the keyboard, or by rotating the mouse wheel. Of course, it's also possible to turn these options off:

Entering numbers with a Spinner field

How to do it...

  1. Create a form panel:
    var formPanel = Ext.create('Ext.form.Panel', { title: 'Spinner Field Example', width: 350, height: 100, bodyPadding: 10, defaults: { labelWidth: 150 }, items: [], renderTo: ...

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