Alert Message Box in ExtJS



Alert Message Box in ExtJS :

In Order to Show Message box we need to include following files inside head part.

<link rel="stylesheet"type="text/css"
              href="lib/extjs/resources/css/ext-all.css"/>
 <script src="lib/extjs/adapter/ext/ext-base.js"></script>
 <script src="lib/extjs/ext-all-debug.js"></script>

After including above files we need to write following line to open Alert Message Box in ExtJS -

Ext.MessageBox.alert('Hello', 'Welcome to ExtJS');

Live Example : Complete Code

<html>
  <head>
        <title>First ExtJs Example</title>
        <link rel="stylesheet"type="text/css"
              href="lib/extjs/resources/css/ext-all.css"/>
        <script src="lib/extjs/adapter/ext/ext-base.js"></script>
        <script src="lib/extjs/ext-all-debug.js"></script>
        <script>
            Ext.onReady(function(){
                Ext.MessageBox.alert('Hello', 'Welcome to ExtJS');
            });
         </script>
  </head>
  <body>
       <!-- Nothing in the body -->
  </body>
</html>

Output :