A simple button

Once we know how the Ext.util.Observable base class works and the methods that we can use, it's time to dig into the widgets. We're going to start with the buttons. In order to create a button we need to instantiate the Ext.button.Button class. This class manages all the ins and outs of a single button.

Let's create an HTML file and import the Ext library and instantiate the Button class as follows:

<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Button</title> <!-- Importing the Ext JS library --> <script type="text/javascript" src="../ext-4.1.1a-gpl/ext-all-dev.js"></script> <linkrel="stylesheet" href="../ext-4.1.1a-gpl/resources/css/ext-all.css" /> <script type="text/javascript"> ...

Get Learning Ext JS 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.