Upgrade to ExtJS 3.0.3 - Released 10/11/2009
[extjs.git] / examples / statusbar / statusbar-demo.js
index 7a21d15..79cf28f 100644 (file)
@@ -1,18 +1,9 @@
 /*!
- * Ext JS Library 3.0.0
+ * Ext JS Library 3.0.3
  * Copyright(c) 2006-2009 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
-/*\r
- * Ext JS Library 2.2\r
- * Copyright(c) 2006-2008, Ext JS, LLC.\r
- * licensing@extjs.com\r
- *\r
- * http://extjs.com/license\r
- */\r
-\r
-\r
 Ext.onReady(function(){\r
 \r
     // This is a shared function that simulates a load action on a StatusBar.\r
@@ -36,7 +27,7 @@ Ext.onReady(function(){
     new Ext.Panel({\r
         title: 'Basic StatusBar',\r
         renderTo: 'basic',\r
-        width: 350,\r
+        width: 550,\r
         height: 100,\r
         bodyStyle: 'padding:10px;',\r
         items:[{\r
@@ -46,11 +37,48 @@ Ext.onReady(function(){
             handler: loadFn.createCallback('basic-button', 'basic-statusbar')\r
         }],\r
         bbar: new Ext.ux.StatusBar({\r
-            defaultText: 'Default status',\r
             id: 'basic-statusbar',\r
-               items: [{\r
-                   text: 'A Button'\r
-               }, '-', 'Plain Text', ' ', ' ']\r
+\r
+            // defaults to use when the status is cleared:\r
+            defaultText: 'Default status text',\r
+            //defaultIconCls: 'default-icon',\r
+        \r
+            // values to set initially:\r
+            text: 'Ready',\r
+            iconCls: 'x-status-valid',\r
+\r
+            // any standard Toolbar items:\r
+            items: [\r
+                {\r
+                    text: 'Show Warning & Clear',\r
+                    handler: function (){\r
+                        var sb = Ext.getCmp('basic-statusbar');\r
+                        sb.setStatus({\r
+                            text: 'Oops!',\r
+                            iconCls: 'x-status-error',\r
+                            clear: true // auto-clear after a set interval\r
+                        });\r
+                    }\r
+                },\r
+                {\r
+                    text: 'Show Busy',\r
+                    handler: function (){\r
+                        var sb = Ext.getCmp('basic-statusbar');\r
+                        // Set the status bar to show that something is processing:\r
+                        sb.showBusy();\r
+                    }\r
+                },\r
+                {\r
+                    text: 'Clear status',\r
+                    handler: function (){\r
+                        var sb = Ext.getCmp('basic-statusbar');\r
+                        // once completed\r
+                        sb.clearStatus(); \r
+                    }\r
+                },\r
+                '-',\r
+                'Plain Text'\r
+            ]\r
         })\r
     });\r
 \r
@@ -60,7 +88,7 @@ Ext.onReady(function(){
     new Ext.Panel({\r
         title: 'Right-aligned StatusBar',\r
         renderTo: 'right-aligned',\r
-        width: 350,\r
+        width: 550,\r
         height: 100,\r
         bodyStyle: 'padding:10px;',\r
         items:[{\r