Pman.Dialog.AdminCoreEnum.bjs
[Pman.Admin] / Pman.Dialog.AdminCoreEnum.bjs
index 2db791c..3cf7c64 100644 (file)
@@ -1,19 +1,27 @@
 {
-    "id": "roo-file-313",
+    "id": "roo-file-180",
     "name": "Pman.Dialog.AdminCoreEnum",
     "parent": "",
     "title": "",
-    "path": "/home/chris/gitlive/Pman.Admin/Pman.Dialog.AdminCoreEnum.bjs",
+    "path": "/home/alan/gitlive/Pman.Admin/Pman.Dialog.AdminCoreEnum.bjs",
     "items": [
         {
-            "|xns": "Roo",
+            "height": 400,
+            "title": "Pulldown Options",
+            "width": 950,
             "xtype": "LayoutDialog",
+            "|xns": "Roo",
             "items": [
+                {
+                    "|xns": "Roo",
+                    "xtype": "LayoutRegion",
+                    "*prop": "center"
+                },
                 {
                     "listeners": {
-                        "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
+                        "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n     //   _this.grid.footer.onClick('first');\n    }\n}"
                     },
-                    "background": true,
+                    "background": false,
                     "fitContainer": true,
                     "fitToframe": true,
                     "region": "center",
@@ -24,7 +32,7 @@
                     "items": [
                         {
                             "listeners": {
-                                "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
+                                "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n   //    this.footer.onClick('first');\n    }\n}",
                                 "afteredit": "function (e)\n{\n   e.record.commit();     \n}",
                                 "cellclick": "function (_self, rowIndex, columnIndex, e)\n{\n\n        var di = this.colModel.getDataIndex(columnIndex);\n        if (di != 'active') {\n            return;\n        }\n         \n        var rec = _this.grid.ds.getAt(rowIndex);\n        \n        rec.set('active', rec.data.active ? 0 : 1);\n        rec.commit();\n         \n        \n}",
                                 "beforeedit": "function (e)\n{\n    if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){\n        return false;\n    }\n}"
                                     "displayInfo": true,
                                     "displayMsg": "Displaying core_enum{0} - {1} of {2}",
                                     "emptyMsg": "No core_enum found",
-                                    "|xns": "Roo",
-                                    "items": [
-                                        {
-                                            "listeners": {
-                                                "click": "function (_self, e)\n{\n    new Pman.Download({\n        grid : _this.grid\n    });\n    Roo.MessageBox.alert(\"Downloading\", \"File is downloading\");\n}"
-                                            },
-                                            "text": "Download",
-                                            "xtype": "Button",
-                                            "|xns": "Roo.Toolbar"
-                                        }
-                                    ]
+                                    "|xns": "Roo"
                                 },
                                 {
                                     "*prop": "toolbar",
                                             "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
                                             "|xns": "Roo.Toolbar"
                                         },
-                                        {
-                                            "listeners": {
-                                                "|click": "function()\n{\n    \n    // if we do not have a selected type... - what should we show..?\n    var et = _this.etypeCombo.getValue();\n    \n    if (!et) {\n        Roo.MessageBox.alert(\"Error\", \"Select a pulldown\");\n        return;\n    }\n    var sc = _this.grid.getSelectionModel().getSelectedCell();\n    Roo.log(sc);\n    var ds = _this.grid.ds.getAt(sc[0]);\n    if (!ds) {\n        Roo.MessageBox.alert(\"Error\", \"Select enum\");\n        return;\n    }\n    \n    Roo.log(ds);\n    Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){\n        _this.grid.footer.onClick('first');\n    });\n    \n}\n"
-                                            },
-                                            "cls": "x-btn-text-icon",
-                                            "text": "Add Images",
-                                            "xtype": "Button",
-                                            "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
-                                            "|xns": "Roo.Toolbar"
-                                        },
                                         {
                                             "|xns": "Roo.Toolbar",
                                             "xtype": "Fill"
-                                        },
-                                        {
-                                            "listeners": {
-                                                "|click": "function()\n{\n    \n    Roo.MessageBox.prompt (\"Create a new Enum type\",\n        \"Enter the name for a new enum type, \" + \n        \"this is only relivant if you  know how it is going to be used\",\n        function(btn,txt) {\n            if (btn != 'ok') {\n                return; \n            }\n            new Pman.Request({\n                url : baseURL + '/Roo/Core_enum.php',\n                method : 'POST',\n                params : {\n                    etype : '',\n                    name : txt,\n                    active : 1\n                }, \n                success : function() {\n                    Roo.MessageBox.alert(\"Created\", \"You can now select it from the type list on the left\");\n                }\n            });\n                    \n            \n             \n             \n        }\n    ); \n         \n         \n\n}\n"
-                                            },
-                                            "cls": "x-btn-text-icon",
-                                            "text": "Add new pulldown list",
-                                            "xtype": "Button",
-                                            "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
-                                            "|xns": "Roo.Toolbar"
                                         }
                                     ]
                                 },
                             ]
                         }
                     ]
+                },
+                {
+                    "*prop": "buttons[]",
+                    "text": "OK",
+                    "xtype": "Button",
+                    "|xns": "Roo"
                 }
             ]
         }