]> git.proxmox.com Git - extjs.git/blobdiff - extjs/examples/kitchensink/classic/samples/view/pivot/ConfiguratorController.js
import ExtJS 7.0.0 GPL
[extjs.git] / extjs / examples / kitchensink / classic / samples / view / pivot / ConfiguratorController.js
index 9562dae1b7c7c3f8cfcbf4db2c8ad72580c1a63d..58c34fe82f4991665205c3b3871fcf574da7f00d 100644 (file)
@@ -1,15 +1,40 @@
-/**\r
- * Controls the configurator example.\r
- */\r
-Ext.define('KitchenSink.view.pivot.ConfiguratorController', {\r
-    extend: 'Ext.app.ViewController',\r
-\r
-    alias: 'controller.pivotconfig',\r
-\r
-    changeDock: function(button, checked){\r
-        if(checked) {\r
-            this.getView().getPlugin('configurator').setDock(button.text.toLowerCase());\r
-        }\r
-    }\r
-\r
-});
\ No newline at end of file
+/**
+ * Controls the configurator example.
+ */
+Ext.define('KitchenSink.view.pivot.ConfiguratorController', {
+    extend: 'Ext.app.ViewController',
+
+    alias: 'controller.pivotconfig',
+
+    changeDock: function(button, checked) {
+        if (checked) {
+            this.getView().getPlugin('configurator').setDock(button.text.toLowerCase());
+        }
+    },
+
+    getCustomMenus: function(panel, options) {
+        options.menu.add({
+            text: 'Custom menu item',
+            handler: function() {
+                Ext.Msg.alert('Custom menu item', Ext.String.format('Do something for "{0}"', options.field.getHeader()));
+            }
+        });
+    },
+
+    yearLabelRenderer: function(value) {
+        return 'Year ' + value;
+    },
+
+    monthLabelRenderer: function(value) {
+        return Ext.Date.monthNames[value];
+    },
+
+    coloredRenderer: function(v, meta) {
+        if (meta) {
+            meta.style = Ext.String.format('color: {0};', v > 500 ? 'green' : 'red');
+        }
+
+        return Ext.util.Format.number(v, '0,000.00');
+    }
+
+});