Pman.Tab.AdminWatches.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 28 Sep 2011 07:23:47 +0000 (15:23 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 28 Sep 2011 07:23:47 +0000 (15:23 +0800)
Pman.Tab.AdminWatches.bjs
Pman.Tab.AdminWatches.js
Pman.Tab.AdminWatches.js

Pman.Tab.AdminWatches.bjs
Pman.Tab.AdminWatches.js

index e06dcc7..60aa2b5 100644 (file)
@@ -4,7 +4,170 @@
     "parent": "Pman.Tab.Admin",
     "title": "Pman.Tab.AdminWatches",
     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminWatches.bjs",
-    "items": [],
+    "items": [
+        {
+            "|xns": "Roo",
+            "xtype": "GridPanel",
+            "title": "core_watch",
+            "fitToframe": true,
+            "fitContainer": true,
+            "tableName": "core_watch",
+            "background": true,
+            "region": "center",
+            "listeners": {
+                "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
+            },
+            "items": [
+                {
+                    "*prop": "grid",
+                    "xtype": "Grid",
+                    "autoExpandColumn": "ontable",
+                    "loadMask": true,
+                    "listeners": {
+                        "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
+                        "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
+                    },
+                    "|xns": "Roo.grid",
+                    "items": [
+                        {
+                            "*prop": "dataSource",
+                            "xtype": "Store",
+                            "remoteSort": true,
+                            "|sortInfo": "{ field : 'ontable', direction: 'ASC' }",
+                            "|xns": "Roo.data",
+                            "items": [
+                                {
+                                    "*prop": "proxy",
+                                    "xtype": "HttpProxy",
+                                    "method": "GET",
+                                    "|url": "baseURL + '/Roo/core_watch.php'",
+                                    "|xns": "Roo.data"
+                                },
+                                {
+                                    "|xns": "Roo.data",
+                                    "xtype": "JsonReader",
+                                    "totalProperty": "total",
+                                    "root": "data",
+                                    "*prop": "reader",
+                                    "id": "id",
+                                    "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'event',\n        'type': 'string'\n    },\n    {\n        'name': 'medium',\n        'type': 'string'\n    },\n    {\n        'name': 'active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_dt',\n        'type': 'date'\n    }\n]"
+                                }
+                            ]
+                        },
+                        {
+                            "*prop": "footer",
+                            "xtype": "PagingToolbar",
+                            "pageSize": 25,
+                            "displayInfo": true,
+                            "displayMsg": "Displaying core_watch{0} - {1} of {2}",
+                            "emptyMsg": "No core_watch found",
+                            "|xns": "Roo"
+                        },
+                        {
+                            "*prop": "toolbar",
+                            "xtype": "Toolbar",
+                            "|xns": "Roo",
+                            "items": [
+                                {
+                                    "text": "Add",
+                                    "xtype": "Button",
+                                    "cls": "x-btn-text-icon",
+                                    "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
+                                    "listeners": {
+                                        "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
+                                    },
+                                    "|xns": "Roo.Toolbar"
+                                },
+                                {
+                                    "text": "Edit",
+                                    "xtype": "Button",
+                                    "cls": "x-btn-text-icon",
+                                    "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
+                                    "listeners": {
+                                        "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
+                                    },
+                                    "|xns": "Roo.Toolbar"
+                                },
+                                {
+                                    "text": "Delete",
+                                    "cls": "x-btn-text-icon",
+                                    "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
+                                    "xtype": "Button",
+                                    "listeners": {
+                                        "|click": "function()\n{\n     Pman.genericDelete(_this, 'core_watch'); \n}\n        "
+                                    },
+                                    "|xns": "Roo.Toolbar"
+                                }
+                            ]
+                        },
+                        {
+                            "xtype": "ColumnModel",
+                            "header": "Id",
+                            "width": 75,
+                            "dataIndex": "id",
+                            "|renderer": "function(v) { return String.format('{0}', v); }",
+                            "|xns": "Roo.grid",
+                            "*prop": "colModel[]"
+                        },
+                        {
+                            "xtype": "ColumnModel",
+                            "header": "Ontable",
+                            "width": 200,
+                            "dataIndex": "ontable",
+                            "|renderer": "function(v) { return String.format('{0}', v); }",
+                            "|xns": "Roo.grid",
+                            "*prop": "colModel[]"
+                        },
+                        {
+                            "xtype": "ColumnModel",
+                            "header": "Onid",
+                            "width": 75,
+                            "dataIndex": "onid",
+                            "|renderer": "function(v) { return String.format('{0}', v); }",
+                            "|xns": "Roo.grid",
+                            "*prop": "colModel[]"
+                        },
+                        {
+                            "xtype": "ColumnModel",
+                            "header": "Person",
+                            "width": 75,
+                            "dataIndex": "person_id",
+                            "|renderer": "function(v) { return String.format('{0}', v); }",
+                            "|xns": "Roo.grid",
+                            "*prop": "colModel[]"
+                        },
+                        {
+                            "xtype": "ColumnModel",
+                            "header": "Event",
+                            "width": 200,
+                            "dataIndex": "event",
+                            "|renderer": "function(v) { return String.format('{0}', v); }",
+                            "|xns": "Roo.grid",
+                            "*prop": "colModel[]"
+                        },
+                        {
+                            "xtype": "ColumnModel",
+                            "header": "Medium",
+                            "width": 200,
+                            "dataIndex": "medium",
+                            "|renderer": "function(v) { return String.format('{0}', v); }",
+                            "|xns": "Roo.grid",
+                            "*prop": "colModel[]"
+                        },
+                        {
+                            "xtype": "ColumnModel",
+                            "header": "Active",
+                            "width": 75,
+                            "dataIndex": "active",
+                            "|renderer": "function(v) { return String.format('{0}', v); }",
+                            "|xns": "Roo.grid",
+                            "*prop": "colModel[]"
+                        }
+                    ]
+                }
+            ]
+        }
+    ],
     "permname": "",
     "modOrder": "860"
 }
\ No newline at end of file
index c227083..fa546c3 100644 (file)
@@ -1 +1,321 @@
-0
\ No newline at end of file
+//<script type="text/javascript">
+
+// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
+
+
+
+// register the module first
+Pman.on('beforeload', function()
+{
+    Pman.register({
+        modKey : '860-Pman.Tab.AdminWatches',
+        module : Pman.Tab.AdminWatches,
+        region : 'center',
+        parent : Pman.Tab.Admin,
+        name : "Pman.Tab.AdminWatches",
+        disabled : false, 
+        permname: '' 
+    });
+});
+
+Pman.Tab.AdminWatches = new Roo.util.Observable({
+
+    panel : false,
+    disabled : false,
+    parentLayout:  false,
+
+    add : function(parentLayout, region)
+    {
+
+        var _this = this;
+        this.parentLayout = parentLayout;
+
+        this.panel = parentLayout.addxtype({
+            xtype: 'GridPanel',
+            xns: Roo,
+            title : "core_watch",
+            fitToframe : true,
+            fitContainer : true,
+            tableName : 'core_watch',
+            background : true,
+            region : 'center',
+            listeners : {
+                activate : function() {
+                    _this.panel = this;
+                    if (_this.grid) {
+                        _this.grid.footer.onClick('first');
+                    }
+                }
+            },
+            grid : {
+                xtype: 'Grid',
+                xns: Roo.grid,
+                autoExpandColumn : 'ontable',
+                loadMask : true,
+                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)
+                    {
+                        if (!_this.dialog) return;
+                        _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
+                            _this.grid.footer.onClick('first');
+                        }); 
+                    }
+                },
+                dataSource : {
+                    xtype: 'Store',
+                    xns: Roo.data,
+                    remoteSort : true,
+                    sortInfo : { field : 'ontable', direction: 'ASC' },
+                    proxy : {
+                        xtype: 'HttpProxy',
+                        xns: Roo.data,
+                        method : 'GET',
+                        url : baseURL + '/Roo/core_watch.php'
+                    },
+                    reader : {
+                        xtype: 'JsonReader',
+                        xns: Roo.data,
+                        totalProperty : 'total',
+                        root : 'data',
+                        id : 'id',
+                        fields : [
+                            {
+                                'name': 'id',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'ontable',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'onid',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'person_id',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'event',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'medium',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'active',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'person_id_id',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'person_id_office_id',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'person_id_name',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'person_id_phone',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'person_id_fax',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'person_id_email',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'person_id_company_id',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'person_id_role',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'person_id_active',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'person_id_remarks',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'person_id_passwd',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'person_id_owner_id',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'person_id_lang',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'person_id_no_reset_sent',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'person_id_action_type',
+                                'type': 'string'
+                            },
+                            {
+                                'name': 'person_id_project_id',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'person_id_deleted_by',
+                                'type': 'int'
+                            },
+                            {
+                                'name': 'person_id_deleted_dt',
+                                'type': 'date'
+                            }
+                        ]
+                    }
+                },
+                footer : {
+                    xtype: 'PagingToolbar',
+                    xns: Roo,
+                    pageSize : 25,
+                    displayInfo : true,
+                    displayMsg : "Displaying core_watch{0} - {1} of {2}",
+                    emptyMsg : "No core_watch found"
+                },
+                toolbar : {
+                    xtype: 'Toolbar',
+                    xns: Roo,
+                    items : [
+                        {
+                            xtype: 'Button',
+                            xns: Roo.Toolbar,
+                            text : "Add",
+                            cls : 'x-btn-text-icon',
+                            icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
+                            listeners : {
+                                click : function()
+                                {
+                                    if (!_this.dialog) return;
+                                    _this.dialog.show( { id : 0 } , function() {
+                                        _this.grid.footer.onClick('first');
+                                   }); 
+                                }
+                            }
+                        },
+                        {
+                            xtype: 'Button',
+                            xns: Roo.Toolbar,
+                            text : "Edit",
+                            cls : 'x-btn-text-icon',
+                            icon : Roo.rootURL + 'images/default/tree/leaf.gif',
+                            listeners : {
+                                click : function()
+                                {
+                                    var s = _this.grid.getSelectionModel().getSelections();
+                                    if (!s.length || (s.length > 1))  {
+                                        Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
+                                        return;
+                                    }
+                                    if (!_this.dialog) return;
+                                    _this.dialog.show(s[0].data, function() {
+                                        _this.grid.footer.onClick('first');
+                                    }); 
+                                    
+                                }
+                            }
+                        },
+                        {
+                            xtype: 'Button',
+                            xns: Roo.Toolbar,
+                            text : "Delete",
+                            cls : 'x-btn-text-icon',
+                            icon : rootURL + '/Pman/templates/images/trash.gif',
+                            listeners : {
+                                click : function()
+                                {
+                                     Pman.genericDelete(_this, 'core_watch'); 
+                                }
+                            }
+                        }
+                    ]
+                },
+                colModel : [
+                    {
+                        xtype: 'ColumnModel',
+                        xns: Roo.grid,
+                        header : 'Id',
+                        width : 75,
+                        dataIndex : 'id',
+                        renderer : function(v) { return String.format('{0}', v); }
+                    },
+                    {
+                        xtype: 'ColumnModel',
+                        xns: Roo.grid,
+                        header : 'Ontable',
+                        width : 200,
+                        dataIndex : 'ontable',
+                        renderer : function(v) { return String.format('{0}', v); }
+                    },
+                    {
+                        xtype: 'ColumnModel',
+                        xns: Roo.grid,
+                        header : 'Onid',
+                        width : 75,
+                        dataIndex : 'onid',
+                        renderer : function(v) { return String.format('{0}', v); }
+                    },
+                    {
+                        xtype: 'ColumnModel',
+                        xns: Roo.grid,
+                        header : 'Person',
+                        width : 75,
+                        dataIndex : 'person_id',
+                        renderer : function(v) { return String.format('{0}', v); }
+                    },
+                    {
+                        xtype: 'ColumnModel',
+                        xns: Roo.grid,
+                        header : 'Event',
+                        width : 200,
+                        dataIndex : 'event',
+                        renderer : function(v) { return String.format('{0}', v); }
+                    },
+                    {
+                        xtype: 'ColumnModel',
+                        xns: Roo.grid,
+                        header : 'Medium',
+                        width : 200,
+                        dataIndex : 'medium',
+                        renderer : function(v) { return String.format('{0}', v); }
+                    },
+                    {
+                        xtype: 'ColumnModel',
+                        xns: Roo.grid,
+                        header : 'Active',
+                        width : 75,
+                        dataIndex : 'active',
+                        renderer : function(v) { return String.format('{0}', v); }
+                    }
+                ]
+            }
+        });
+        this.layout = this.panel.layout;
+
+    }
+});