pulldown js error
authorMicheal <micheal@roojs.com>
Mon, 26 Jan 2015 05:44:00 +0000 (13:44 +0800)
committerMicheal <micheal@roojs.com>
Mon, 26 Jan 2015 05:44:00 +0000 (13:44 +0800)
Pman.Dialog.AdminEnumImages.bjs
Pman.Dialog.AdminEnumImages.js
Pman.Dialog.AdminEnumType.bjs
Pman.Dialog.AdminEnumType.bjs~ [new file with mode: 0644]
Pman.Dialog.AdminEnumType.js
Pman.Dialog.AdminGenericName.bjs
Pman.Dialog.AdminGenericName.js
Pman.Tab.AdminEnum.bjs
Pman.Tab.AdminEnum.js

index d73244a..372f041 100644 (file)
 {
-    "id": "roo-file-266",
-    "name": "Pman.Dialog.AdminEnumImages",
-    "parent": "",
-    "title": "",
-    "path": "/home/chris/gitlive/Pman.Admin/Pman.Dialog.AdminEnumImages.bjs",
-    "items": [
+    "name" : "Pman.Dialog.AdminEnumImages",
+    "parent" : "",
+    "title" : "",
+    "path" : "/home/michael/gitlive/Pman.Admin/Pman.Dialog.AdminEnumImages.bjs",
+    "permname" : "",
+    "modOrder" : "001",
+    "items" : [
         {
-            "listeners": {
-                "show": "function (_self)\n{\n    _this.grid.footer.onClick('first');\n}"
+            "listeners" : {
+                "show" : "function (_self)\n{\n    _this.grid.footer.onClick('first');\n}"
             },
-            "height": 500,
-            "modal": true,
-            "title": "Add / Edit Images",
-            "width": 900,
-            "xtype": "LayoutDialog",
-            "|xns": "Roo",
-            "items": [
+            "modal" : true,
+            "title" : "Add / Edit Images",
+            "xtype" : "LayoutDialog",
+            "width" : 900,
+            "$ xns" : "Roo",
+            "height" : 500,
+            "items" : [
                 {
-                    "|xns": "Roo",
-                    "xtype": "LayoutRegion",
-                    "*prop": "center"
+                    "xtype" : "LayoutRegion",
+                    "$ xns" : "Roo",
+                    "* prop" : "center"
                 },
                 {
-                    "listeners": {
-                        "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
+                    "listeners" : {
+                        "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
                     },
-                    "background": false,
-                    "fitContainer": true,
-                    "fitToframe": true,
-                    "region": "center",
-                    "tableName": "Images",
-                    "title": "Images",
-                    "xtype": "GridPanel",
-                    "|xns": "Roo",
-                    "items": [
+                    "fitToframe" : true,
+                    "background" : false,
+                    "region" : "center",
+                    "title" : "Images",
+                    "xtype" : "GridPanel",
+                    "fitContainer" : true,
+                    "$ xns" : "Roo",
+                    "tableName" : "Images",
+                    "items" : [
                         {
-                            "listeners": {
-                                "|render": "function() { \n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    //if (_this.panel.active) {\n    //   this.footer.onClick('first');\n    //}\n}",
-                                "|rowdblclick": "function (_self, rowIndex, e)\n{\n  \n   var s =  _self.getDataSource().getAt(rowIndex);\n     Pman.Dialog.PressReleaseImage.show(s.data, function() {\n                _this.grid.footer.onClick('first');\n               }); \n}"
+                            "listeners" : {
+                                "|rowdblclick" : "function (_self, rowIndex, e)\n{\n  \n   var s =  _self.getDataSource().getAt(rowIndex);\n     Pman.Dialog.PressReleaseImage.show(s.data, function() {\n                _this.grid.footer.onClick('first');\n               }); \n}",
+                                "|render" : "function() { \n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    //if (_this.panel.active) {\n    //   this.footer.onClick('first');\n    //}\n}"
                             },
-                            "*prop": "grid",
-                            "autoExpandColumn": "title",
-                            "loadMask": true,
-                            "xtype": "Grid",
-                            "|xns": "Roo.grid",
-                            "items": [
+                            "autoExpandColumn" : "title",
+                            "xtype" : "Grid",
+                            "loadMask" : true,
+                            "$ xns" : "Roo.grid",
+                            "* prop" : "grid",
+                            "items" : [
                                 {
-                                    "listeners": {
-                                        "|beforeload": "function (_self, o)\n{\n    //o.params.ontable = 'Companies';\n    \n  //   o.params.imgtype = 'PressRelease';\n    \n    o.params = o.params || {};\n    o.params.onid = _this.data.onid;\n    o.params.ontable = 'core_enum';\n    Roo.log(_this);\n    \n}",
-                                        "|load": "function (_self, records, options)\n{\n _this.panel.el.unmask();\n}"
+                                    "listeners" : {
+                                        "|beforeload" : "function (_self, o)\n{\n    //o.params.ontable = 'Companies';\n    \n  //   o.params.imgtype = 'PressRelease';\n    \n    o.params = o.params || {};\n    o.params.onid = _this.data.onid;\n    o.params.ontable = 'core_enum';\n    Roo.log(_this);\n    \n}",
+                                        "|load" : "function (_self, records, options)\n{\n _this.panel.el.unmask();\n}"
                                     },
-                                    "*prop": "dataSource",
-                                    "remoteSort": true,
-                                    "xtype": "Store",
-                                    "|sortInfo": "{ field: 'created' , direction: 'DESC' }",
-                                    "|xns": "Roo.data",
-                                    "items": [
+                                    "xtype" : "Store",
+                                    "remoteSort" : true,
+                                    "$ sortInfo" : "{ field: 'created' , direction: 'DESC' }",
+                                    "$ xns" : "Roo.data",
+                                    "* prop" : "dataSource",
+                                    "items" : [
                                         {
-                                            "*prop": "reader",
-                                            "id": "id",
-                                            "root": "data",
-                                            "totalProperty": "total",
-                                            "xtype": "JsonReader",
-                                            "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'filename',\n        'type': 'string'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'width',\n        'type': 'int'\n    },\n    {\n        'name': 'height',\n        'type': 'int'\n    },\n    {\n        'name': 'filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created',\n        'type': 'date',\n        'dateFormat' : 'Y-m-d H:i:s'\n    },\n    {\n        'name': 'imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'descript',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    }\n]",
-                                            "|xns": "Roo.data"
+                                            "id" : "id",
+                                            "root" : "data",
+                                            "xtype" : "JsonReader",
+                                            "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'filename',\n        'type': 'string'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'width',\n        'type': 'int'\n    },\n    {\n        'name': 'height',\n        'type': 'int'\n    },\n    {\n        'name': 'filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created',\n        'type': 'date',\n        'dateFormat' : 'Y-m-d H:i:s'\n    },\n    {\n        'name': 'imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'descript',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    }\n]",
+                                            "$ xns" : "Roo.data",
+                                            "* prop" : "reader",
+                                            "totalProperty" : "total"
                                         },
                                         {
-                                            "*prop": "proxy",
-                                            "xtype": "HttpProxy",
-                                            "method": "GET",
-                                            "|url": "baseURL + '/Roo/Images.php'",
-                                            "|xns": "Roo.data"
+                                            "$ url" : "baseURL + '/Roo/Images.php'",
+                                            "method" : "GET",
+                                            "xtype" : "HttpProxy",
+                                            "$ xns" : "Roo.data",
+                                            "* prop" : "proxy"
                                         }
                                     ]
                                 },
                                 {
-                                    "*prop": "footer",
-                                    "xtype": "PagingToolbar",
-                                    "pageSize": 25,
-                                    "displayInfo": true,
-                                    "displayMsg": "Displaying Images  {0} - {1} of {2}",
-                                    "emptyMsg": "No Images found",
-                                    "|xns": "Roo"
+                                    "pageSize" : 25,
+                                    "xtype" : "PagingToolbar",
+                                    "emptyMsg" : "No Images found",
+                                    "$ xns" : "Roo",
+                                    "displayInfo" : true,
+                                    "displayMsg" : "Displaying Images  {0} - {1} of {2}",
+                                    "* prop" : "footer"
                                 },
                                 {
-                                    "*prop": "toolbar",
-                                    "xtype": "Toolbar",
-                                    "|xns": "Roo",
-                                    "items": [
+                                    "xtype" : "Toolbar",
+                                    "$ xns" : "Roo",
+                                    "* prop" : "toolbar",
+                                    "items" : [
                                         {
-                                            "listeners": {
-                                                "|click": "function()\n{\n            \n    //var sel = Pman.Tab.PressReleaseCompanies  ? Pman.Tab.PressReleaseCompanies.grid.getSelectionModel().getSelected() : false\n     \n    Pman.Dialog.Image.show({\n        id : 0, \n        ontable: 'core_enum',\n        onid: _this.data.onid,\n        imgtype : ''\n    }, function(data){\n        if (!data) { return; } \n        _this.grid.footer.onClick('first');\n    }); \n\n}       "
+                                            "listeners" : {
+                                                "|click" : "function()\n{\n            \n    //var sel = Pman.Tab.PressReleaseCompanies  ? Pman.Tab.PressReleaseCompanies.grid.getSelectionModel().getSelected() : false\n     \n    Pman.Dialog.Image.show({\n        id : 0, \n        ontable: 'core_enum',\n        onid: _this.data.onid,\n        imgtype : ''\n    }, function(data){\n        if (!data) { return; } \n        _this.grid.footer.onClick('first');\n    }); \n\n}       "
                                             },
-                                            "cls": "x-btn-text-icon",
-                                            "text": "Add",
-                                            "xtype": "Button",
-                                            "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
-                                            "|xns": "Roo.Toolbar"
+                                            "text" : "Add",
+                                            "xtype" : "Button",
+                                            "cls" : "x-btn-text-icon",
+                                            "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
+                                            "$ xns" : "Roo.Toolbar"
                                         },
                                         {
-                                            "listeners": {
-                                                "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s || s.length != 1) {\n        Roo.MessageBox.alert(\"Error\", \"Select a single image to edit\");\n       return;\n     }\n     var data = _this.grid.getDataSource().getById(s[0].data.id).data;\n    \n             Pman.Dialog.PressReleaseImage.show(data, function() {\n                _this.grid.footer.onClick('first');\n               }); \n            \n        }\n        "
+                                            "listeners" : {
+                                                "|click" : "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s || s.length != 1) {\n        Roo.MessageBox.alert(\"Error\", \"Select a single image to edit\");\n       return;\n     }\n     var data = _this.grid.getDataSource().getById(s[0].data.id).data;\n    \n             Pman.Dialog.PressReleaseImage.show(data, function() {\n                _this.grid.footer.onClick('first');\n               }); \n            \n        }\n        "
                                             },
-                                            "cls": "x-btn-text-icon",
-                                            "text": "Edit",
-                                            "xtype": "Button",
-                                            "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
-                                            "|xns": "Roo"
+                                            "text" : "Edit",
+                                            "xtype" : "Button",
+                                            "cls" : "x-btn-text-icon",
+                                            "$ icon" : "Roo.rootURL + 'images/default/tree/leaf.gif'",
+                                            "$ xns" : "Roo"
                                         },
                                         {
-                                            "listeners": {
-                                                "|click": "function()\n        {\n        Pman.genericDelete(_this, 'Images'); \n        }\n        "
+                                            "listeners" : {
+                                                "|click" : "function()\n        {\n        Pman.genericDelete(_this, 'Images'); \n        }\n        "
                                             },
-                                            "cls": "x-btn-text-icon",
-                                            "text": "Delete",
-                                            "xtype": "Button",
-                                            "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
-                                            "|xns": "Roo.Toolbar"
+                                            "text" : "Delete",
+                                            "xtype" : "Button",
+                                            "cls" : "x-btn-text-icon",
+                                            "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
+                                            "$ xns" : "Roo.Toolbar"
                                         }
                                     ]
                                 },
                                 {
-                                    "xtype": "ColumnModel",
-                                    "header": "Created",
-                                    "width": 100,
-                                    "dataIndex": "created",
-                                    "|renderer": "function(v,x,r) {\n       return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',\n            v.format('d/M/Y'), r.data.mimetype, r.data.filename,\n    r.data.width, r.data.height\n    ); \n}\n     ",
-                                    "listeners": {},
-                                    "sortable": true,
-                                    "|xns": "Roo.grid",
-                                    "*prop": "colModel[]"
+                                    "xtype" : "ColumnModel",
+                                    "sortable" : true,
+                                    "width" : 100,
+                                    "header" : "Created",
+                                    "$ renderer" : "function(v,x,r) {\n       return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',\n            v.format('d/M/Y'), r.data.mimetype, r.data.filename,\n    r.data.width, r.data.height\n    ); \n}\n     ",
+                                    "$ xns" : "Roo.grid",
+                                    "* prop" : "colModel[]",
+                                    "dataIndex" : "created"
                                 },
                                 {
-                                    "*prop": "colModel[]",
-                                    "dataIndex": "id",
-                                    "header": "Image",
-                                    "width": 100,
-                                    "xtype": "ColumnModel",
-                                    "|renderer": "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/100/{1}/{2}\" width=\"100\">', baseURL, v, r.data.filename); }",
-                                    "|xns": "Roo.grid"
+                                    "xtype" : "ColumnModel",
+                                    "header" : "Image",
+                                    "width" : 100,
+                                    "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/100/{1}/{2}\" width=\"100\">', baseURL, v, r.data.filename); }",
+                                    "$ xns" : "Roo.grid",
+                                    "* prop" : "colModel[]",
+                                    "dataIndex" : "id"
                                 },
                                 {
-                                    "*prop": "colModel[]",
-                                    "dataIndex": "title",
-                                    "header": "Title",
-                                    "width": 100,
-                                    "xtype": "ColumnModel",
-                                    "|renderer": "function(v,x,r) {\n//     var surl = r.json.url.replace(/\\/release.php\\/Images\\//, '/i/').replace(/\\/([0-9]+)\\/.*$/, '/$1');;\n  //   var svurl = r.json.url_view.replace(/\\/release.php\\/Images\\//, '/i/').replace(/\\/([0-9]+)\\/.*$/, '/$1');;\n    //  return String.format(\n      //    'Download Url : <a href=\"http://{0}{1}\" target=\"_new\">http://{0}{1}</a>' + \n        //  '<br/>View Url : <a href=\"http://{0}{2}\" target=\"_new\">http://{0}{2}</a>' + \n          //'<br/><b>{3}</b><br/>{4}</i>', \n         // window.location.host, surl, svurl,\n          // v, r.json.descript); \n     \n    }",
-                                    "|xns": "Roo.grid"
+                                    "xtype" : "ColumnModel",
+                                    "header" : "Title",
+                                    "width" : 100,
+                                    "$ renderer" : "function(v,x,r) {\n//     var surl = r.json.url.replace(/\\/release.php\\/Images\\//, '/i/').replace(/\\/([0-9]+)\\/.*$/, '/$1');;\n  //   var svurl = r.json.url_view.replace(/\\/release.php\\/Images\\//, '/i/').replace(/\\/([0-9]+)\\/.*$/, '/$1');;\n    //  return String.format(\n      //    'Download Url : <a href=\"http://{0}{1}\" target=\"_new\">http://{0}{1}</a>' + \n        //  '<br/>View Url : <a href=\"http://{0}{2}\" target=\"_new\">http://{0}{2}</a>' + \n          //'<br/><b>{3}</b><br/>{4}</i>', \n         // window.location.host, surl, svurl,\n          // v, r.json.descript); \n     \n    }",
+                                    "$ xns" : "Roo.grid",
+                                    "* prop" : "colModel[]",
+                                    "dataIndex" : "title"
                                 }
                             ]
                         }
                     ]
                 },
                 {
-                    "listeners": {
-                        "click": "function (_self, e)\n{\n    _this.dialog.hide();\n    _this.callback(true);\n}"
+                    "listeners" : {
+                        "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n    _this.callback(true);\n}"
                     },
-                    "*prop": "buttons[]",
-                    "text": "Close",
-                    "xtype": "Button",
-                    "|xns": "Roo"
+                    "text" : "Close",
+                    "xtype" : "Button",
+                    "$ xns" : "Roo",
+                    "* prop" : "buttons[]"
                 }
             ]
         }
-    ],
-    "permname": "",
-    "modOrder": "001"
+    ]
 }
\ No newline at end of file
index 13cfa26..52c4009 100644 (file)
@@ -2,6 +2,8 @@
 
 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
 
+Roo.namespace('Pman.Dialog');
+
 Pman.Dialog.AdminEnumImages = {
 
     dialog : false,
@@ -28,87 +30,48 @@ Pman.Dialog.AdminEnumImages = {
     {
         var _this = this;
         this.dialog = Roo.factory({
-            xtype: 'LayoutDialog',
-            xns: Roo,
-            listeners : {
-                show : function (_self)
-                {
-                    _this.grid.footer.onClick('first');
-                }
+            center : {
+                '|xns' : 'Roo',
+                xtype : 'LayoutRegion',
+                xns : Roo
             },
-            height : 500,
+            '|xns' : 'Roo',
             modal : true,
             title : "Add / Edit Images",
+            xtype : 'LayoutDialog',
             width : 900,
+            xns : Roo,
+            height : 500,
+            buttons : [
+                {
+                       '|xns' : 'Roo',
+                       text : "Close",
+                       xtype : 'Button',
+                       xns : Roo,
+                       listeners : {
+                               click : function (_self, e)
+                                  {
+                                      _this.dialog.hide();
+                                      _this.callback(true);
+                                  }
+                       }
+                   }
+            ],
+            listeners : {
+               show : function (_self)
+                  {
+                      _this.grid.footer.onClick('first');
+                  }
+            },
             items : [
-                {
-                    xtype: 'GridPanel',
-                    xns: Roo,
-                    listeners : {
-                        activate : function() {
-                            _this.panel = this;
-                            if (_this.grid) {
-                                _this.grid.footer.onClick('first');
-                            }
-                        }
-                    },
-                    background : false,
-                    fitContainer : true,
-                    fitToframe : true,
-                    region : 'center',
-                    tableName : 'Images',
-                    title : "Images",
+               {
                     grid : {
-                        xtype: 'Grid',
-                        xns: Roo.grid,
-                        listeners : {
-                            render : function() { 
-                                _this.grid = this; 
-                                //_this.dialog = Pman.Dialog.FILL_IN
-                                //if (_this.panel.active) {
-                                //   this.footer.onClick('first');
-                                //}
-                            },
-                            rowdblclick : function (_self, rowIndex, e)
-                            {
-                              
-                               var s =  _self.getDataSource().getAt(rowIndex);
-                                 Pman.Dialog.PressReleaseImage.show(s.data, function() {
-                                            _this.grid.footer.onClick('first');
-                                           }); 
-                            }
-                        },
-                        autoExpandColumn : 'title',
-                        loadMask : true,
                         dataSource : {
-                            xtype: 'Store',
-                            xns: Roo.data,
-                            listeners : {
-                                beforeload : function (_self, o)
-                                {
-                                    //o.params.ontable = 'Companies';
-                                    
-                                  //   o.params.imgtype = 'PressRelease';
-                                    
-                                    o.params = o.params || {};
-                                    o.params.onid = _this.data.onid;
-                                    o.params.ontable = 'core_enum';
-                                    Roo.log(_this);
-                                    
-                                },
-                                load : function (_self, records, options)
-                                {
-                                 _this.panel.el.unmask();
-                                }
-                            },
-                            remoteSort : true,
-                            sortInfo : { field: 'created' , direction: 'DESC' },
                             reader : {
-                                xtype: 'JsonReader',
-                                xns: Roo.data,
+                                '|xns' : 'Roo.data',
                                 id : 'id',
                                 root : 'data',
-                                totalProperty : 'total',
+                                xtype : 'JsonReader',
                                 fields : [
                                     {
                                         'name': 'id',
@@ -175,153 +138,222 @@ Pman.Dialog.AdminEnumImages = {
                                         'name': 'title',
                                         'type': 'string'
                                     }
-                                ]
+                                ],
+                                xns : Roo.data,
+                                totalProperty : 'total'
                             },
                             proxy : {
-                                xtype: 'HttpProxy',
-                                xns: Roo.data,
+                                '|xns' : 'Roo.data',
+                                url : baseURL + '/Roo/Images.php',
                                 method : 'GET',
-                                url : baseURL + '/Roo/Images.php'
-                            }
+                                xtype : 'HttpProxy',
+                                xns : Roo.data
+                            },
+                            '|xns' : 'Roo.data',
+                            xtype : 'Store',
+                            remoteSort : true,
+                            sortInfo : { field: 'created' , direction: 'DESC' },
+                            xns : Roo.data,
+                            listeners : {
+                               beforeload : function (_self, o)
+                                  {
+                                      //o.params.ontable = 'Companies';
+                                      
+                                    //   o.params.imgtype = 'PressRelease';
+                                      
+                                      o.params = o.params || {};
+                                      o.params.onid = _this.data.onid;
+                                      o.params.ontable = 'core_enum';
+                                      Roo.log(_this);
+                                      
+                                  },
+                               load : function (_self, records, options)
+                                  {
+                                   _this.panel.el.unmask();
+                                  }
+                            },
+                            items : [
+
+                            ]
+
                         },
                         footer : {
-                            xtype: 'PagingToolbar',
-                            xns: Roo,
+                            '|xns' : 'Roo',
                             pageSize : 25,
+                            xtype : 'PagingToolbar',
+                            emptyMsg : "No Images found",
+                            xns : Roo,
                             displayInfo : true,
-                            displayMsg : "Displaying Images  {0} - {1} of {2}",
-                            emptyMsg : "No Images found"
+                            displayMsg : "Displaying Images  {0} - {1} of {2}"
                         },
                         toolbar : {
-                            xtype: 'Toolbar',
-                            xns: Roo,
+                            '|xns' : 'Roo',
+                            xtype : 'Toolbar',
+                            xns : Roo,
                             items : [
-                                {
-                                    xtype: 'Button',
-                                    xns: Roo.Toolbar,
-                                    listeners : {
-                                        click : function()
-                                        {
-                                                    
-                                            //var sel = Pman.Tab.PressReleaseCompanies  ? Pman.Tab.PressReleaseCompanies.grid.getSelectionModel().getSelected() : false
-                                             
-                                            Pman.Dialog.Image.show({
-                                                id : 0, 
-                                                ontable: 'core_enum',
-                                                onid: _this.data.onid,
-                                                imgtype : ''
-                                            }, function(data){
-                                                if (!data) { return; } 
-                                                _this.grid.footer.onClick('first');
-                                            }); 
-                                        
-                                        }
-                                    },
-                                    cls : 'x-btn-text-icon',
+                               {
+                                    '|xns' : 'Roo.Toolbar',
                                     text : "Add",
-                                    icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
-                                },
-                                {
-                                    xtype: 'Button',
-                                    xns: Roo,
-                                    listeners : {
-                                        click : function()
-                                        {
-                                            var s = _this.grid.getSelectionModel().getSelections();
-                                            if (!s || s.length != 1) {
-                                                Roo.MessageBox.alert("Error", "Select a single image to edit");
-                                               return;
-                                             }
-                                             var data = _this.grid.getDataSource().getById(s[0].data.id).data;
-                                            
-                                                     Pman.Dialog.PressReleaseImage.show(data, function() {
-                                                        _this.grid.footer.onClick('first');
-                                                       }); 
-                                                    
-                                                }
-                                    },
+                                    xtype : 'Button',
                                     cls : 'x-btn-text-icon',
-                                    text : "Edit",
-                                    icon : Roo.rootURL + 'images/default/tree/leaf.gif'
-                                },
-                                {
-                                    xtype: 'Button',
-                                    xns: Roo.Toolbar,
+                                    icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
+                                    xns : Roo.Toolbar,
                                     listeners : {
-                                        click : function()
-                                                {
-                                                Pman.genericDelete(_this, 'Images'); 
-                                                }
-                                    },
+                                       click : function()
+                                          {
+                                                      
+                                              //var sel = Pman.Tab.PressReleaseCompanies  ? Pman.Tab.PressReleaseCompanies.grid.getSelectionModel().getSelected() : false
+                                               
+                                              Pman.Dialog.Image.show({
+                                                  id : 0, 
+                                                  ontable: 'core_enum',
+                                                  onid: _this.data.onid,
+                                                  imgtype : ''
+                                              }, function(data){
+                                                  if (!data) { return; } 
+                                                  _this.grid.footer.onClick('first');
+                                              }); 
+                                          
+                                          }
+                                    }
+                                },
+                               {
+                                    '|xns' : 'Roo',
+                                    text : "Edit",
+                                    xtype : 'Button',
                                     cls : 'x-btn-text-icon',
+                                    icon : Roo.rootURL + 'images/default/tree/leaf.gif',
+                                    xns : Roo,
+                                    listeners : {
+                                       click : function()
+                                          {
+                                              var s = _this.grid.getSelectionModel().getSelections();
+                                              if (!s || s.length != 1) {
+                                                  Roo.MessageBox.alert("Error", "Select a single image to edit");
+                                                 return;
+                                               }
+                                               var data = _this.grid.getDataSource().getById(s[0].data.id).data;
+                                              
+                                                       Pman.Dialog.PressReleaseImage.show(data, function() {
+                                                          _this.grid.footer.onClick('first');
+                                                         }); 
+                                                      
+                                                  }
+                                    }
+                                },
+                               {
+                                    '|xns' : 'Roo.Toolbar',
                                     text : "Delete",
-                                    icon : rootURL + '/Pman/templates/images/trash.gif'
+                                    xtype : 'Button',
+                                    cls : 'x-btn-text-icon',
+                                    icon : rootURL + '/Pman/templates/images/trash.gif',
+                                    xns : Roo.Toolbar,
+                                    listeners : {
+                                       click : function()
+                                                  {
+                                                  Pman.genericDelete(_this, 'Images'); 
+                                                  }
+                                    }
                                 }
                             ]
+
                         },
+                        '|xns' : 'Roo.grid',
+                        autoExpandColumn : 'title',
+                        xtype : 'Grid',
+                        loadMask : true,
+                        xns : Roo.grid,
                         colModel : [
-                            {
-                                xtype: 'ColumnModel',
-                                xns: Roo.grid,
-                                header : 'Created',
-                                width : 100,
-                                dataIndex : 'created',
-                                renderer : function(v,x,r) {
-                                       return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',
-                                            v.format('d/M/Y'), r.data.mimetype, r.data.filename,
-                                    r.data.width, r.data.height
-                                    ); 
-                                },
-                                sortable : true
-                            },
-                            {
-                                xtype: 'ColumnModel',
-                                xns: Roo.grid,
-                                dataIndex : 'id',
-                                header : 'Image',
-                                width : 100,
-                                renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" width="100">', baseURL, v, r.data.filename); }
-                            },
-                            {
-                                xtype: 'ColumnModel',
-                                xns: Roo.grid,
-                                dataIndex : 'title',
-                                header : 'Title',
-                                width : 100,
-                                renderer : function(v,x,r) {
-                                //     var surl = r.json.url.replace(/\/release.php\/Images\//, '/i/').replace(/\/([0-9]+)\/.*$/, '/$1');;
-                                  //   var svurl = r.json.url_view.replace(/\/release.php\/Images\//, '/i/').replace(/\/([0-9]+)\/.*$/, '/$1');;
-                                    //  return String.format(
-                                      //    'Download Url : <a href="http://{0}{1}" target="_new">http://{0}{1}</a>' + 
-                                        //  '<br/>View Url : <a href="http://{0}{2}" target="_new">http://{0}{2}</a>' + 
-                                          //'<br/><b>{3}</b><br/>{4}</i>', 
-                                         // window.location.host, surl, svurl,
-                                          // v, r.json.descript); 
-                                     
-                                    }
-                            }
+                                {
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : true,
+                                       width : 100,
+                                       header : 'Created',
+                                       renderer : function(v,x,r) {
+                                              return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',
+                                                   v.format('d/M/Y'), r.data.mimetype, r.data.filename,
+                                           r.data.width, r.data.height
+                                           ); 
+                                       },
+                                       xns : Roo.grid,
+                                       dataIndex : 'created'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       header : 'Image',
+                                       width : 100,
+                                       renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" width="100">', baseURL, v, r.data.filename); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'id'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       header : 'Title',
+                                       width : 100,
+                                       renderer : function(v,x,r) {
+                                       //     var surl = r.json.url.replace(/\/release.php\/Images\//, '/i/').replace(/\/([0-9]+)\/.*$/, '/$1');;
+                                         //   var svurl = r.json.url_view.replace(/\/release.php\/Images\//, '/i/').replace(/\/([0-9]+)\/.*$/, '/$1');;
+                                           //  return String.format(
+                                             //    'Download Url : <a href="http://{0}{1}" target="_new">http://{0}{1}</a>' + 
+                                               //  '<br/>View Url : <a href="http://{0}{2}" target="_new">http://{0}{2}</a>' + 
+                                                 //'<br/><b>{3}</b><br/>{4}</i>', 
+                                                // window.location.host, surl, svurl,
+                                                 // v, r.json.descript); 
+                                            
+                                           },
+                                       xns : Roo.grid,
+                                       dataIndex : 'title'
+                                   }
+                        ],
+                        listeners : {
+                               rowdblclick : function (_self, rowIndex, e)
+                                  {
+                                    
+                                     var s =  _self.getDataSource().getAt(rowIndex);
+                                       Pman.Dialog.PressReleaseImage.show(s.data, function() {
+                                                  _this.grid.footer.onClick('first');
+                                                 }); 
+                                  },
+                               render : function() { 
+                                      _this.grid = this; 
+                                      //_this.dialog = Pman.Dialog.FILL_IN
+                                      //if (_this.panel.active) {
+                                      //   this.footer.onClick('first');
+                                      //}
+                                  }
+                        },
+                        items : [
+
                         ]
-                    }
-                }
-            ],
-            center : {
-                xtype: 'LayoutRegion',
-                xns: Roo
-            },
-            buttons : [
-                {
-                    xtype: 'Button',
-                    xns: Roo,
+
+                    },
+                    '|xns' : 'Roo',
+                    fitToframe : true,
+                    background : false,
+                    region : 'center',
+                    title : "Images",
+                    xtype : 'GridPanel',
+                    fitContainer : true,
+                    xns : Roo,
+                    tableName : 'Images',
                     listeners : {
-                        click : function (_self, e)
-                        {
-                            _this.dialog.hide();
-                            _this.callback(true);
-                        }
+                       activate : function() {
+                              _this.panel = this;
+                              if (_this.grid) {
+                                  _this.grid.footer.onClick('first');
+                              }
+                          }
                     },
-                    text : "Close"
+                    items : [
+
+                    ]
+
                 }
             ]
+
         });
     }
 };
index d189b18..5253214 100644 (file)
@@ -7,33 +7,78 @@
     "modOrder" : "001",
     "items" : [
         {
+            "Boolean modal" : true,
+            "Number width" : 480,
             "xtype" : "LayoutDialog",
+            "Number height" : 160,
+            "Boolean resizable" : false,
             "$ xns" : "Roo",
+            "String title" : "Edit",
             "items" : [
                 {
                     "xtype" : "LayoutRegion",
                     "$ xns" : "Roo",
-                    "String title" : "Edit"
+                    "* prop" : "center\n"
                 },
                 {
                     "xtype" : "ContentPanel",
+                    "String region" : "center",
                     "$ xns" : "Roo",
                     "items" : [
                         {
+                            "listeners" : {
+                                "rendered" : "function (form)\n{\n    _this.form = this;\n}",
+                                "|actioncomplete" : "function (_self, action)\n{\n    if(action.type == 'submit'){\n        _this.dialog.hide();\n    }\n}"
+                            },
+                            "$ url" : "baseURL + '/Roo/Core_enum'",
                             "xtype" : "Form",
-                            "$ xns" : "Roo.form"
+                            "$ xns" : "Roo.form",
+                            "items" : [
+                                {
+                                    "String name" : "name",
+                                    "Number width" : 270,
+                                    "xtype" : "TextField",
+                                    "String fieldLabel" : "Name",
+                                    "$ xns" : "Roo.form"
+                                },
+                                {
+                                    "String name" : "id",
+                                    "xtype" : "Hidden",
+                                    "$ xns" : "Roo.form"
+                                },
+                                {
+                                    "String name" : "etype",
+                                    "xtype" : "Hidden",
+                                    "$ xns" : "Roo.form"
+                                },
+                                {
+                                    "String name" : "display_name",
+                                    "Number width" : 270,
+                                    "xtype" : "TextField",
+                                    "String fieldLabel" : "Display Name",
+                                    "$ xns" : "Roo.form"
+                                }
+                            ]
                         }
                     ]
                 },
                 {
+                    "listeners" : {
+                        "click" : "function (_self, e)\n{\n    //this.url = baseURL + '/Roo/Core_enum.php';\n    //_this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n}"
+                    },
                     "xtype" : "Button",
                     "String text" : "Save",
-                    "$ xns" : "Roo"
+                    "$ xns" : "Roo",
+                    "* prop" : "buttons[]"
                 },
                 {
+                    "listeners" : {
+                        "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
+                    },
                     "xtype" : "Button",
                     "String text" : "Cancel",
-                    "$ xns" : "Roo"
+                    "$ xns" : "Roo",
+                    "* prop" : "buttons[]"
                 }
             ]
         }
diff --git a/Pman.Dialog.AdminEnumType.bjs~ b/Pman.Dialog.AdminEnumType.bjs~
new file mode 100644 (file)
index 0000000..a1c0286
--- /dev/null
@@ -0,0 +1,44 @@
+{
+    "name" : "Pman.Dialog.AdminEnumType",
+    "parent" : "",
+    "title" : "",
+    "path" : "/home/alan/gitlive/Pman.Admin/Pman.Dialog.AdminEnumType.bjs",
+    "permname" : "",
+    "modOrder" : "001",
+    "items" : [
+        {
+            "xtype" : "LayoutDialog",
+            "$ xns" : "Roo",
+            "items" : [
+                {
+                    "xtype" : "LayoutRegion",
+<<<<<<< HEAD
+                    "$ xns" : "Roo",
+                    "String title" : "Edit"
+                },
+                {
+                    "xtype" : "ContentPanel",
+                    "$ xns" : "Roo",
+                    "items" : [
+                        {
+                            "xtype" : "Form",
+                            "$ xns" : "Roo.form"
+                        }
+                    ]
+                },
+                {
+                    "xtype" : "Button",
+                    "String text" : "Save",
+                    "$ xns" : "Roo"
+                },
+                {
+                    "xtype" : "Button",
+                    "String text" : "Cancel",
+=======
+>>>>>>> be2b32ec3940f51083d62854828ab95a2787c3c2
+                    "$ xns" : "Roo"
+                }
+            ]
+        }
+    ]
+}
\ No newline at end of file
index c35b3f4..aea4d2f 100644 (file)
@@ -30,40 +30,106 @@ Pman.Dialog.AdminEnumType = {
     {
         var _this = this;
         this.dialog = Roo.factory({
+            center
+ : {
+                '|xns' : 'Roo',
+                xtype : 'LayoutRegion',
+                xns : Roo
+            },
             '|xns' : 'Roo',
+            modal : true,
+            width : 480,
             xtype : 'LayoutDialog',
+            height : 160,
+            resizable : false,
             xns : Roo,
+            title : "Edit",
+            buttons : [
+                {
+                       '|xns' : 'Roo',
+                       xtype : 'Button',
+                       text : "Save",
+                       xns : Roo,
+                       listeners : {
+                               click : function (_self, e)
+                                  {
+                                      //this.url = baseURL + '/Roo/Core_enum.php';
+                                      //_this.dialog.el.mask("Saving");
+                                      _this.form.doAction("submit");
+                                  }
+                       }
+                   },
+{
+                       '|xns' : 'Roo',
+                       xtype : 'Button',
+                       text : "Cancel",
+                       xns : Roo,
+                       listeners : {
+                               click : function (_self, e)
+                                  {
+                                      _this.dialog.hide();
+                                  }
+                       }
+                   }
+            ],
             items : [
-               {
-                    '|xns' : 'Roo',
-                    xtype : 'LayoutRegion',
-                    xns : Roo,
-                    title : "Edit"
-                },
                {
                     '|xns' : 'Roo',
                     xtype : 'ContentPanel',
+                    region : 'center',
                     xns : Roo,
                     items : [
                        {
                             '|xns' : 'Roo.form',
+                            url : baseURL + '/Roo/Core_enum',
                             xtype : 'Form',
-                            xns : Roo.form
+                            xns : Roo.form,
+                            listeners : {
+                               rendered : function (form)
+                                  {
+                                      _this.form = this;
+                                  },
+                               actioncomplete : function (_self, action)
+                                  {
+                                      if(action.type == 'submit'){
+                                          _this.dialog.hide();
+                                      }
+                                  }
+                            },
+                            items : [
+                               {
+                                    '|xns' : 'Roo.form',
+                                    name : 'name',
+                                    width : 270,
+                                    xtype : 'TextField',
+                                    fieldLabel : 'Name',
+                                    xns : Roo.form
+                                },
+                               {
+                                    '|xns' : 'Roo.form',
+                                    name : 'id',
+                                    xtype : 'Hidden',
+                                    xns : Roo.form
+                                },
+                               {
+                                    '|xns' : 'Roo.form',
+                                    name : 'etype',
+                                    xtype : 'Hidden',
+                                    xns : Roo.form
+                                },
+                               {
+                                    '|xns' : 'Roo.form',
+                                    name : 'display_name',
+                                    width : 270,
+                                    xtype : 'TextField',
+                                    fieldLabel : 'Display Name',
+                                    xns : Roo.form
+                                }
+                            ]
+
                         }
                     ]
 
-                },
-               {
-                    '|xns' : 'Roo',
-                    xtype : 'Button',
-                    text : "Save",
-                    xns : Roo
-                },
-               {
-                    '|xns' : 'Roo',
-                    xtype : 'Button',
-                    text : "Cancel",
-                    xns : Roo
                 }
             ]
 
index a364f85..aa7ef43 100644 (file)
@@ -1,83 +1,82 @@
 {
-    "id": "roo-file-151",
-    "name": "Pman.Dialog.AdminGenericName",
-    "parent": "",
-    "title": "",
-    "path": "/home/alan/gitlive/Pman.Admin/Pman.Dialog.AdminGenericName.bjs",
-    "items": [
+    "name" : "Pman.Dialog.AdminGenericName",
+    "parent" : "",
+    "title" : "",
+    "path" : "/home/michael/gitlive/Pman.Admin/Pman.Dialog.AdminGenericName.bjs",
+    "permname" : "",
+    "modOrder" : "001",
+    "items" : [
         {
-            "closable": false,
-            "collapsible": false,
-            "height": 120,
-            "modal": true,
-            "resizable": false,
-            "title": "Edit",
-            "width": 400,
-            "xtype": "LayoutDialog",
-            "|xns": "Roo",
-            "items": [
+            "modal" : true,
+            "collapsible" : false,
+            "title" : "Edit",
+            "xtype" : "LayoutDialog",
+            "width" : 400,
+            "$ xns" : "Roo",
+            "closable" : false,
+            "resizable" : false,
+            "height" : 120,
+            "items" : [
                 {
-                    "|xns": "Roo",
-                    "xtype": "LayoutRegion",
-                    "*prop": "center"
+                    "xtype" : "LayoutRegion",
+                    "$ xns" : "Roo",
+                    "* prop" : "center"
                 },
                 {
-                    "region": "center",
-                    "xtype": "ContentPanel",
-                    "|xns": "Roo",
-                    "items": [
+                    "region" : "center",
+                    "xtype" : "ContentPanel",
+                    "$ xns" : "Roo",
+                    "items" : [
                         {
-                            "listeners": {
-                                "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       this.url = baseURL + '/Roo/' + _this.data._table;\n       _this.dialog.setTitle(_this.data._title);\n       this.load({ \n            method: 'GET', \n            params: { '_id' : _this.data.id },\n            url : this.url\n        });\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        _this.form.findField('name').focus();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
-                                "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
+                            "listeners" : {
+                                "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       this.url = baseURL + '/Roo/' + _this.data._table;\n       _this.dialog.setTitle(_this.data._title);\n       this.load({ \n            method: 'GET', \n            params: { '_id' : _this.data.id },\n            url : this.url\n        });\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        _this.form.findField('name').focus();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
+                                "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
                             },
-                            "labelWidth": 50,
-                            "method": "POST",
-                            "style": "margin:10px;",
-                            "xtype": "Form",
-                            "|url": "baseURL + '/Roo/core_company_type.php'",
-                            "|xns": "Roo.form",
-                            "items": [
+                            "$ url" : "baseURL + '/Roo/core_company_type.php'",
+                            "style" : "margin:10px;",
+                            "method" : "POST",
+                            "xtype" : "Form",
+                            "labelWidth" : 50,
+                            "$ xns" : "Roo.form",
+                            "items" : [
                                 {
-                                    "listeners": {
-                                        "specialkey": "function (_self, e)\n{\n    if (e.getKey() == 13) {\n         _this.dialog.el.mask(\"Saving\");\n         _this.form.doAction(\"submit\");\n    }\n}"
+                                    "listeners" : {
+                                        "specialkey" : "function (_self, e)\n{\n    if (e.getKey() == 13) {\n         _this.dialog.el.mask(\"Saving\");\n         _this.form.doAction(\"submit\");\n    }\n}"
                                     },
-                                    "fieldLabel": "Name",
-                                    "name": "name",
-                                    "width": 270,
-                                    "xtype": "TextField",
-                                    "|xns": "Roo.form"
+                                    "fieldLabel" : "Name",
+                                    "xtype" : "TextField",
+                                    "width" : 270,
+                                    "$ xns" : "Roo.form",
+                                    "name" : "name"
                                 },
                                 {
-                                    "name": "id",
-                                    "|xns": "Roo.form",
-                                    "xtype": "Hidden"
+                                    "xtype" : "Hidden",
+                                    "$ xns" : "Roo.form",
+                                    "name" : "id"
                                 }
                             ]
                         }
                     ]
                 },
                 {
-                    "listeners": {
-                        "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
+                    "listeners" : {
+                        "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
                     },
-                    "*prop": "buttons[]",
-                    "text": "Cancel",
-                    "xtype": "Button",
-                    "|xns": "Roo"
+                    "text" : "Cancel",
+                    "xtype" : "Button",
+                    "$ xns" : "Roo",
+                    "* prop" : "buttons[]"
                 },
                 {
-                    "listeners": {
-                        "click": "function (_self, e)\n{\n    // do some checks?\n     \n     this.url = baseURL + '/Roo/' + _this.data._table;\n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
+                    "listeners" : {
+                        "click" : "function (_self, e)\n{\n    // do some checks?\n     \n     this.url = baseURL + '/Roo/' + _this.data._table;\n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
                     },
-                    "*prop": "buttons[]",
-                    "text": "Save",
-                    "xtype": "Button",
-                    "|xns": "Roo"
+                    "text" : "Save",
+                    "xtype" : "Button",
+                    "$ xns" : "Roo",
+                    "* prop" : "buttons[]"
                 }
             ]
         }
-    ],
-    "permname": "",
-    "modOrder": "001"
+    ]
 }
\ No newline at end of file
index 944d52c..f2cff14 100644 (file)
@@ -2,6 +2,8 @@
 
 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
 
+Roo.namespace('Pman.Dialog');
+
 Pman.Dialog.AdminGenericName = {
 
     dialog : false,
@@ -28,124 +30,135 @@ Pman.Dialog.AdminGenericName = {
     {
         var _this = this;
         this.dialog = Roo.factory({
-            xtype: 'LayoutDialog',
-            xns: Roo,
-            closable : false,
-            collapsible : false,
-            height : 120,
+            center : {
+                '|xns' : 'Roo',
+                xtype : 'LayoutRegion',
+                xns : Roo
+            },
+            '|xns' : 'Roo',
             modal : true,
-            resizable : false,
+            collapsible : false,
             title : "Edit",
+            xtype : 'LayoutDialog',
             width : 400,
+            xns : Roo,
+            closable : false,
+            resizable : false,
+            height : 120,
+            buttons : [
+                {
+                       '|xns' : 'Roo',
+                       text : "Cancel",
+                       xtype : 'Button',
+                       xns : Roo,
+                       listeners : {
+                               click : function (_self, e)
+                                  {
+                                      _this.dialog.hide();
+                                  }
+                       }
+                   },
+{
+                       '|xns' : 'Roo',
+                       text : "Save",
+                       xtype : 'Button',
+                       xns : Roo,
+                       listeners : {
+                               click : function (_self, e)
+                                  {
+                                      // do some checks?
+                                       
+                                       this.url = baseURL + '/Roo/' + _this.data._table;
+                                      _this.dialog.el.mask("Saving");
+                                      _this.form.doAction("submit");
+                                  
+                                  }
+                       }
+                   }
+            ],
             items : [
-                {
-                    xtype: 'ContentPanel',
-                    xns: Roo,
+               {
+                    '|xns' : 'Roo',
                     region : 'center',
+                    xtype : 'ContentPanel',
+                    xns : Roo,
                     items : [
-                        {
-                            xtype: 'Form',
-                            xns: Roo.form,
+                       {
+                            '|xns' : 'Roo.form',
+                            url : baseURL + '/Roo/core_company_type.php',
+                            style : 'margin:10px;',
+                            method : 'POST',
+                            xtype : 'Form',
+                            labelWidth : 50,
+                            xns : Roo.form,
                             listeners : {
-                                actioncomplete : function(_self,action)
-                                {
-                                    if (action.type == 'setdata') {
-                                       //_this.dialog.el.mask("Loading");
-                                       this.url = baseURL + '/Roo/' + _this.data._table;
-                                       _this.dialog.setTitle(_this.data._title);
-                                       this.load({ 
-                                            method: 'GET', 
-                                            params: { '_id' : _this.data.id },
-                                            url : this.url
-                                        });
-                                       return;
-                                    }
-                                    if (action.type == 'load') {
-                                        _this.dialog.el.unmask();
-                                        _this.form.findField('name').focus();
-                                        return;
-                                    }
-                                    if (action.type =='submit') {
-                                    
-                                        _this.dialog.el.unmask();
-                                        _this.dialog.hide();
-                                    
-                                         if (_this.callback) {
-                                            _this.callback.call(_this, _this.form.getValues());
-                                         }
-                                         _this.form.reset();
-                                         return;
-                                    }
-                                },
-                                rendered : function (form)
-                                {
-                                    _this.form= form;
-                                }
+                               actioncomplete : function(_self,action)
+                                  {
+                                      if (action.type == 'setdata') {
+                                         //_this.dialog.el.mask("Loading");
+                                         this.url = baseURL + '/Roo/' + _this.data._table;
+                                         _this.dialog.setTitle(_this.data._title);
+                                         this.load({ 
+                                              method: 'GET', 
+                                              params: { '_id' : _this.data.id },
+                                              url : this.url
+                                          });
+                                         return;
+                                      }
+                                      if (action.type == 'load') {
+                                          _this.dialog.el.unmask();
+                                          _this.form.findField('name').focus();
+                                          return;
+                                      }
+                                      if (action.type =='submit') {
+                                      
+                                          _this.dialog.el.unmask();
+                                          _this.dialog.hide();
+                                      
+                                           if (_this.callback) {
+                                              _this.callback.call(_this, _this.form.getValues());
+                                           }
+                                           _this.form.reset();
+                                           return;
+                                      }
+                                  },
+                               rendered : function (form)
+                                  {
+                                      _this.form= form;
+                                  }
                             },
-                            labelWidth : 50,
-                            method : 'POST',
-                            style : 'margin:10px;',
-                            url : baseURL + '/Roo/core_company_type.php',
                             items : [
-                                {
-                                    xtype: 'TextField',
-                                    xns: Roo.form,
-                                    listeners : {
-                                        specialkey : function (_self, e)
-                                        {
-                                            if (e.getKey() == 13) {
-                                                 _this.dialog.el.mask("Saving");
-                                                 _this.form.doAction("submit");
-                                            }
-                                        }
-                                    },
+                               {
+                                    '|xns' : 'Roo.form',
                                     fieldLabel : 'Name',
+                                    xtype : 'TextField',
+                                    width : 270,
+                                    xns : Roo.form,
                                     name : 'name',
-                                    width : 270
+                                    listeners : {
+                                       specialkey : function (_self, e)
+                                          {
+                                              if (e.getKey() == 13) {
+                                                   _this.dialog.el.mask("Saving");
+                                                   _this.form.doAction("submit");
+                                              }
+                                          }
+                                    }
                                 },
-                                {
-                                    xtype: 'Hidden',
-                                    xns: Roo.form,
+                               {
+                                    '|xns' : 'Roo.form',
+                                    xtype : 'Hidden',
+                                    xns : Roo.form,
                                     name : 'id'
                                 }
                             ]
+
                         }
                     ]
-                }
-            ],
-            center : {
-                xtype: 'LayoutRegion',
-                xns: Roo
-            },
-            buttons : [
-                {
-                    xtype: 'Button',
-                    xns: Roo,
-                    listeners : {
-                        click : function (_self, e)
-                        {
-                            _this.dialog.hide();
-                        }
-                    },
-                    text : "Cancel"
-                },
-                {
-                    xtype: 'Button',
-                    xns: Roo,
-                    listeners : {
-                        click : function (_self, e)
-                        {
-                            // do some checks?
-                             
-                             this.url = baseURL + '/Roo/' + _this.data._table;
-                            _this.dialog.el.mask("Saving");
-                            _this.form.doAction("submit");
-                        
-                        }
-                    },
-                    text : "Save"
+
                 }
             ]
+
         });
     }
 };
index 50a70ed..229f6b3 100644 (file)
@@ -8,8 +8,8 @@
     "items" : [
         {
             "xtype" : "NestedLayoutPanel",
-            "String region" : "center",
             "$ xns" : "Roo",
+            "String region" : "center",
             "String title" : "Pulldown Options",
             "items" : [
                 {
@@ -43,8 +43,9 @@
                                 {
                                     "listeners" : {
                                         "beforeedit" : "function (e)\n{\n    if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){\n        return false;\n    }\n}",
-                                        "|render" : "function() \n{\n    _this.egrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.epanel.active) {\n       this.footer.onClick('first');\n    }\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}",
+                                        "|render" : "function() \n{\n    _this.egrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.epanel.active) {\n       this.footer.onClick('first');\n    }\n}",
+                                        "celldblclick" : "function (_self, rowIndex, columnIndex, e)\n{\n    var rec = _this.egrid.ds.getAt(rowIndex);\n    Pman.Dialog.AdminEnumType.show(rec.data,function(){\n        \n        _this.egrid.footer.onClick('first');\n    });\n}",
                                         "afteredit" : "function (e)\n{\n   e.record.commit();     \n}"
                                     },
                                     "autoExpandColumn" : "display_name",
@@ -56,7 +57,7 @@
                                     "items" : [
                                         {
                                             "listeners" : {
-                                                "update" : "function (_self, record, operation)\n{\n    if (operation != Roo.data.Record.COMMIT) {\n        return;\n    }\n    // got commit..\n    new Pman.Request({\n        url : baseURL + '/Roo/Core_enum.php',\n        method : 'POST',\n        params : {\n            id : record.data.id,\n            etype : _this.etypeCombo.getValue(),\n            name : record.data.name,\n            active : record.data.active,\n            seqid : record.data.seqid,\n            display_name : record.data.display_name\n        }, \n        success : function(res) {\n            //Roo.log(data);\n            // update the ID if it's not set..\n            if (record.data.id * 1 < 1) {\n                record.set('id', res.data.id);\n            }\n        }\n    });\n    \n}",
+                                                "update" : "function (_self, record, operation)\n{\n    if (operation != Roo.data.Record.COMMIT) {\n        return;\n    }\n    // got commit..\n    new Pman.Request({\n        url : baseURL + '/Roo/Core_enum.php',\n        method : 'POST',\n        params : {\n            id : record.data.id,\n            etype : _this.grid.ds.getById(record.id).data.etype,\n            name : record.data.name,\n            active : record.data.active,\n            seqid : record.data.seqid,\n            display_name : record.data.display_name\n        }, \n        success : function(res) {\n            //Roo.log(data);\n            // update the ID if it's not set..\n            if (record.data.id * 1 < 1) {\n                record.set('id', res.data.id);\n            }\n        }\n    });\n    \n}",
                                                 "beforeload" : "function (_self, o)\n{\n    o.params['query[empty_etype]'] = 1; \n  \n}"
                                             },
                                             "xtype" : "Store",
@@ -67,8 +68,8 @@
                                             "items" : [
                                                 {
                                                     "$ url" : "baseURL + '/Roo/core_enum.php'",
-                                                    "method" : "GET",
                                                     "xtype" : "HttpProxy",
+                                                    "method" : "GET",
                                                     "$ xns" : "Roo.data",
                                                     "* prop" : "proxy"
                                                 },
                                         },
                                         {
                                             "xtype" : "ColumnModel",
-                                            "width" : 200,
                                             "header" : "Pulldown",
+                                            "width" : 200,
                                             "$ renderer" : "function(v,x,r) { \n\n\n    return String.format('<span qtip=\"{1}\">{0}</span>', (''+v).length ? v : r.data.name, r.data.name); \n}",
                                             "$ xns" : "Roo.grid",
                                             "* prop" : "colModel[]",
                                         },
                                         {
                                             "xtype" : "ColumnModel",
-                                            "width" : 50,
                                             "header" : "Active",
+                                            "width" : 50,
                                             "$ renderer" : "function(v) {  \n    var state = v> 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n                \n }",
                                             "$ xns" : "Roo.grid",
                                             "* prop" : "colModel[]",
                             "listeners" : {
                                 "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
                             },
-                            "region" : "center",
                             "fitToframe" : true,
                             "background" : false,
+                            "region" : "center",
                             "title" : "Pulldown Options",
                             "xtype" : "GridPanel",
                             "$ xns" : "Roo",
                                 {
                                     "listeners" : {
                                         "beforeedit" : "function (e)\n{\n    if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){\n        return false;\n    }\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}",
                                         "|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}",
+                                        "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}",
                                         "afteredit" : "function (e)\n{\n   e.record.commit();     \n}"
                                     },
                                     "autoExpandColumn" : "display_name",
                                     "items" : [
                                         {
                                             "listeners" : {
-                                                "update" : "function (_self, record, operation)\n{\n    if (operation != Roo.data.Record.COMMIT) {\n        return;\n    }\n    // got commit..\n    new Pman.Request({\n        url : baseURL + '/Roo/Core_enum.php',\n        method : 'POST',\n        params : {\n            id : record.data.id,\n            etype : _this.etypeCombo.getValue(),\n            name : record.data.name,\n            active : record.data.active,\n            seqid : record.data.seqid,\n            display_name : record.data.display_name\n        }, \n        success : function(res) {\n            //Roo.log(data);\n            // update the ID if it's not set..\n            if (record.data.id * 1 < 1) {\n                record.set('id', res.data.id);\n            }\n        }\n    });\n    \n}",
+                                                "update" : "function (_self, record, operation)\n{\n    if (operation != Roo.data.Record.COMMIT) {\n        return;\n    }\n    // got commit..\n    new Pman.Request({\n        url : baseURL + '/Roo/Core_enum.php',\n        method : 'POST',\n        params : {\n            id : record.data.id,\n            etype : _this.grid.ds.getById(record.id).data.etype,\n            name : record.data.name,\n            active : record.data.active,\n            seqid : record.data.seqid,\n            display_name : record.data.display_name\n        }, \n        success : function(res) {\n            //Roo.log(data);\n            // update the ID if it's not set..\n            if (record.data.id * 1 < 1) {\n                record.set('id', res.data.id);\n            }\n        }\n    });\n    \n}",
                                                 "beforeload" : "function (_self, options)\n{\n\n    var s =     _this.egrid.getSelectionModel().getSelectedCell();\n    \n\n    if (!s) {\n        return false;\n    }\n    var d = _this.egrid.dataSource.getAt(s[0]);\n    \n    options.params.etype = d.data.name;\n    if (!options.params.etype.length) {\n        return false;\n    }\n}"
                                             },
                                             "xtype" : "Store",
                                             "items" : [
                                                 {
                                                     "$ url" : "baseURL + '/Roo/core_enum.php'",
-                                                    "xtype" : "HttpProxy",
                                                     "method" : "GET",
+                                                    "xtype" : "HttpProxy",
                                                     "$ xns" : "Roo.data",
                                                     "* prop" : "proxy"
                                                 },
                                         },
                                         {
                                             "xtype" : "ColumnModel",
-                                            "header" : "Internal #",
                                             "width" : 75,
+                                            "header" : "Internal #",
                                             "$ renderer" : "function(v) { return String.format('{0}', v); }",
                                             "$ xns" : "Roo.grid",
                                             "* prop" : "colModel[]",
                                         },
                                         {
                                             "xtype" : "ColumnModel",
-                                            "header" : "Image",
                                             "width" : 75,
+                                            "header" : "Image",
                                             "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/25/{1}/{2}\" width=\"25\" height=\"25\">', baseURL, v, r.data.images_id_filename); }",
                                             "$ xns" : "Roo.grid",
                                             "* prop" : "colModel[]",
                                         },
                                         {
                                             "xtype" : "ColumnModel",
-                                            "width" : 200,
                                             "header" : "Name",
+                                            "width" : 200,
                                             "$ renderer" : "function(v) { return String.format('{0}', v); }",
                                             "$ xns" : "Roo.grid",
                                             "* prop" : "colModel[]",
                                         },
                                         {
                                             "xtype" : "ColumnModel",
-                                            "header" : "Display Name",
                                             "width" : 200,
+                                            "header" : "Display Name",
                                             "$ renderer" : "function(v) { return String.format('{0}', v); }",
                                             "$ xns" : "Roo.grid",
                                             "* prop" : "colModel[]",
                                         },
                                         {
                                             "xtype" : "ColumnModel",
-                                            "header" : "Active",
                                             "width" : 75,
+                                            "header" : "Active",
                                             "$ renderer" : "function(v) {  \n    var state = v> 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n                \n }",
                                             "$ xns" : "Roo.grid",
                                             "* prop" : "colModel[]",
index a102bf8..3d34a97 100644 (file)
@@ -40,8 +40,8 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                 proxy : {
                                     '|xns' : 'Roo.data',
                                     url : baseURL + '/Roo/core_enum.php',
-                                    method : 'GET',
                                     xtype : 'HttpProxy',
+                                    method : 'GET',
                                     xns : Roo.data
                                 },
                                 reader : {
@@ -91,7 +91,7 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                                   method : 'POST',
                                                   params : {
                                                       id : record.data.id,
-                                                      etype : _this.etypeCombo.getValue(),
+                                                      etype : _this.grid.ds.getById(record.id).data.etype,
                                                       name : record.data.name,
                                                       active : record.data.active,
                                                       seqid : record.data.seqid,
@@ -198,8 +198,8 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                 {
                                        '|xns' : 'Roo.grid',
                                        xtype : 'ColumnModel',
-                                       width : 200,
                                        header : 'Pulldown',
+                                       width : 200,
                                        renderer : function(v,x,r) { 
                                        
                                        
@@ -211,8 +211,8 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
 {
                                        '|xns' : 'Roo.grid',
                                        xtype : 'ColumnModel',
-                                       width : 50,
                                        header : 'Active',
+                                       width : 50,
                                        renderer : function(v) {  
                                            var state = v> 0 ?  '-checked' : '';
                                        
@@ -230,14 +230,6 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                           return false;
                                       }
                                   },
-                               render : function() 
-                                  {
-                                      _this.egrid = this; 
-                                      //_this.dialog = Pman.Dialog.FILL_IN
-                                      if (_this.epanel.active) {
-                                         this.footer.onClick('first');
-                                      }
-                                  },
                                cellclick : function (_self, rowIndex, columnIndex, e)
                                   {
                                   
@@ -252,6 +244,22 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                           rec.commit();
                                            
                                           
+                                  },
+                               render : function() 
+                                  {
+                                      _this.egrid = this; 
+                                      //_this.dialog = Pman.Dialog.FILL_IN
+                                      if (_this.epanel.active) {
+                                         this.footer.onClick('first');
+                                      }
+                                  },
+                               celldblclick : function (_self, rowIndex, columnIndex, e)
+                                  {
+                                      var rec = _this.egrid.ds.getAt(rowIndex);
+                                      Pman.Dialog.AdminEnumType.show(rec.data,function(){
+                                          
+                                          _this.egrid.footer.onClick('first');
+                                      });
                                   },
                                afteredit : function (e)
                                   {
@@ -289,8 +297,8 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                 proxy : {
                                     '|xns' : 'Roo.data',
                                     url : baseURL + '/Roo/core_enum.php',
-                                    xtype : 'HttpProxy',
                                     method : 'GET',
+                                    xtype : 'HttpProxy',
                                     xns : Roo.data
                                 },
                                 reader : {
@@ -340,7 +348,7 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                                   method : 'POST',
                                                   params : {
                                                       id : record.data.id,
-                                                      etype : _this.etypeCombo.getValue(),
+                                                      etype : _this.grid.ds.getById(record.id).data.etype,
                                                       name : record.data.name,
                                                       active : record.data.active,
                                                       seqid : record.data.seqid,
@@ -535,8 +543,8 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                 {
                                        '|xns' : 'Roo.grid',
                                        xtype : 'ColumnModel',
-                                       header : 'Internal #',
                                        width : 75,
+                                       header : 'Internal #',
                                        renderer : function(v) { return String.format('{0}', v); },
                                        xns : Roo.grid,
                                        dataIndex : 'id'
@@ -544,8 +552,8 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
 {
                                        '|xns' : 'Roo.grid',
                                        xtype : 'ColumnModel',
-                                       header : 'Image',
                                        width : 75,
+                                       header : 'Image',
                                        renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/25/{1}/{2}" width="25" height="25">', baseURL, v, r.data.images_id_filename); },
                                        xns : Roo.grid,
                                        dataIndex : 'images_id_id'
@@ -567,8 +575,8 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                        },
                                        '|xns' : 'Roo.grid',
                                        xtype : 'ColumnModel',
-                                       width : 200,
                                        header : 'Name',
+                                       width : 200,
                                        renderer : function(v) { return String.format('{0}', v); },
                                        xns : Roo.grid,
                                        dataIndex : 'name',
@@ -594,8 +602,8 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                        },
                                        '|xns' : 'Roo.grid',
                                        xtype : 'ColumnModel',
-                                       header : 'Display Name',
                                        width : 200,
+                                       header : 'Display Name',
                                        renderer : function(v) { return String.format('{0}', v); },
                                        xns : Roo.grid,
                                        dataIndex : 'display_name',
@@ -607,8 +615,8 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
 {
                                        '|xns' : 'Roo.grid',
                                        xtype : 'ColumnModel',
-                                       header : 'Active',
                                        width : 75,
+                                       header : 'Active',
                                        renderer : function(v) {  
                                            var state = v> 0 ?  '-checked' : '';
                                        
@@ -657,6 +665,14 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                           return false;
                                       }
                                   },
+                               render : function() 
+                                  {
+                                      _this.grid = this; 
+                                      //_this.dialog = Pman.Dialog.FILL_IN
+                                      if (_this.panel.active) {
+                                         this.footer.onClick('first');
+                                      }
+                                  },
                                cellclick : function (_self, rowIndex, columnIndex, e)
                                   {
                                   
@@ -671,14 +687,6 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
                                           rec.commit();
                                            
                                           
-                                  },
-                               render : function() 
-                                  {
-                                      _this.grid = this; 
-                                      //_this.dialog = Pman.Dialog.FILL_IN
-                                      if (_this.panel.active) {
-                                         this.footer.onClick('first');
-                                      }
                                   },
                                afteredit : function (e)
                                   {
@@ -691,9 +699,9 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
 
                         },
                         '|xns' : 'Roo',
-                        region : 'center',
                         fitToframe : true,
                         background : false,
+                        region : 'center',
                         title : "Pulldown Options",
                         xtype : 'GridPanel',
                         xns : Roo,
@@ -716,8 +724,8 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
             },
             '|xns' : 'Roo',
             xtype : 'NestedLayoutPanel',
-            region : 'center',
             xns : Roo,
+            region : 'center',
             title : "Pulldown Options",
             items : [