-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-Ext.onReady(function(){\r
- // The action\r
- var action = new Ext.Action({\r
- text: 'Action 1',\r
- handler: function(){\r
- Ext.example.msg('Click','You clicked on "Action 1".');\r
- },\r
- iconCls: 'blist'\r
- });\r
-\r
-\r
- var panel = new Ext.Panel({\r
- title: 'Actions',\r
- width:600,\r
- height:300,\r
- bodyStyle: 'padding:10px;', // lazy inline style\r
-\r
- tbar: [\r
- action, { // <-- Add the action directly to a toolbar\r
- text: 'Action Menu',\r
- menu: [action] // <-- Add the action directly to a menu\r
- }\r
- ],\r
-\r
- items: [\r
- new Ext.Button(action) // <-- Add the action as a button\r
- ],\r
-\r
- renderTo: Ext.getBody()\r
- });\r
-\r
-\r
- // Buttons added to the toolbar of the Panel above\r
- // to test/demo doing group operations with an action\r
- panel.getTopToolbar().add('->', {\r
- text: 'Disable',\r
- handler: function(){\r
- action.setDisabled(!action.isDisabled());\r
- this.setText(action.isDisabled() ? 'Enable' : 'Disable');\r
- }\r
- }, {\r
- text: 'Change Text',\r
- handler: function(){\r
- Ext.Msg.prompt('Enter Text', 'Enter new text for Action 1:', function(btn, text){\r
- if(btn == 'ok' && text){\r
- action.setText(text);\r
- action.setHandler(function(){\r
- Ext.example.msg('Click','You clicked on "'+text+'".');\r
- });\r
- }\r
- });\r
- }\r
- }, {\r
- text: 'Change Icon',\r
- handler: function(){\r
- action.setIconClass(action.getIconClass() == 'blist' ? 'bmenu' : 'blist');\r
- }\r
- });\r
+/*!
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
+ */
+Ext.onReady(function(){
+ // The action
+ var action = new Ext.Action({
+ text: 'Action 1',
+ handler: function(){
+ Ext.example.msg('Click','You clicked on "Action 1".');
+ },
+ iconCls: 'blist'
+ });
+
+
+ var panel = new Ext.Panel({
+ title: 'Actions',
+ width:600,
+ height:300,
+ bodyStyle: 'padding:10px;', // lazy inline style
+
+ tbar: [
+ action, { // <-- Add the action directly to a toolbar
+ text: 'Action Menu',
+ menu: [action] // <-- Add the action directly to a menu
+ }
+ ],
+
+ items: [
+ new Ext.Button(action) // <-- Add the action as a button
+ ],
+
+ renderTo: Ext.getBody()
+ });
+
+ var tb = panel.getTopToolbar();
+ // Buttons added to the toolbar of the Panel above
+ // to test/demo doing group operations with an action
+ tb.add('->', {
+ text: 'Disable',
+ handler: function(){
+ action.setDisabled(!action.isDisabled());
+ this.setText(action.isDisabled() ? 'Enable' : 'Disable');
+ }
+ }, {
+ text: 'Change Text',
+ handler: function(){
+ Ext.Msg.prompt('Enter Text', 'Enter new text for Action 1:', function(btn, text){
+ if(btn == 'ok' && text){
+ action.setText(text);
+ action.setHandler(function(){
+ Ext.example.msg('Click','You clicked on "'+text+'".');
+ });
+ }
+ });
+ }
+ }, {
+ text: 'Change Icon',
+ handler: function(){
+ action.setIconClass(action.getIconClass() == 'blist' ? 'bmenu' : 'blist');
+ }
+ });
+ tb.doLayout();
});
\ No newline at end of file