Pman.Tab.AdminContactsGroup.bjs
[Pman.Admin] / Pman.Tab.AdminContactsGroup.bjs
1 {
2     "id": "roo-file-171",
3     "name": "Pman.Tab.AdminContactsGroup",
4     "parent": "Pman.Tab.AdminContactsManager",
5     "title": "Pman.Tab.AdminContactsGroup",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminContactsGroup.bjs",
7     "items": [
8         {
9             "|xns": "Roo",
10             "xtype": "GridPanel",
11             "title": "Groups",
12             "fitToframe": true,
13             "fitContainer": true,
14             "tableName": "Groups",
15             "background": true,
16             "region": "center",
17             "listeners": {
18                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
19             },
20             "items": [
21                 {
22                     "listeners": {
23                         "|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}",
24                         "|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"
25                     },
26                     "*prop": "grid",
27                     "autoExpandColumn": "name",
28                     "ddGroup": "groupDD",
29                     "loadMask": true,
30                     "xtype": "Grid",
31                     "|xns": "Roo.grid",
32                     "items": [
33                         {
34                             "*prop": "dataSource",
35                             "xtype": "Store",
36                             "remoteSort": true,
37                             "|sortInfo": "{ field : 'name', direction: 'ASC' }",
38                             "|xns": "Roo.data",
39                             "items": [
40                                 {
41                                     "*prop": "proxy",
42                                     "xtype": "HttpProxy",
43                                     "method": "GET",
44                                     "|url": "baseURL + '/Roo/Groups.php'",
45                                     "|xns": "Roo.data"
46                                 },
47                                 {
48                                     "|xns": "Roo.data",
49                                     "xtype": "JsonReader",
50                                     "totalProperty": "total",
51                                     "root": "data",
52                                     "*prop": "reader",
53                                     "id": "id",
54                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'type',\n        'type': 'int'\n    },\n    {\n        'name': 'leader',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_name',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_email',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_role',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_active',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_project_id',\n        'type': 'int'\n    }\n]"
55                                 }
56                             ]
57                         },
58                         {
59                             "*prop": "toolbar",
60                             "xtype": "Toolbar",
61                             "|xns": "Roo",
62                             "items": [
63                                 {
64                                     "text": "Manage Groups",
65                                     "xtype": "Button",
66                                     "|xns": "Roo.Toolbar",
67                                     "items": [
68                                         {
69                                             "|xns": "Roo.menu",
70                                             "xtype": "Menu",
71                                             "*prop": "menu",
72                                             "items": [
73                                                 {
74                                                     "listeners": {
75                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n         _this.grid.ds.load({});\n   }); \n}\n"
76                                                     },
77                                                     "cls": "x-btn-text-icon",
78                                                     "text": "Add",
79                                                     "xtype": "Item",
80                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
81                                                     "|xns": "Roo.menu"
82                                                 },
83                                                 {
84                                                     "listeners": {
85                                                         "|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.ds.load({});\n    }); \n    \n}\n"
86                                                     },
87                                                     "cls": "x-btn-text-icon",
88                                                     "text": "Edit",
89                                                     "xtype": "Item",
90                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
91                                                     "|xns": "Roo.menu"
92                                                 },
93                                                 {
94                                                     "listeners": {
95                                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'Groups'); \n}\n        "
96                                                     },
97                                                     "cls": "x-btn-text-icon",
98                                                     "text": "Delete",
99                                                     "xtype": "Item",
100                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
101                                                     "|xns": "Roo.menu"
102                                                 },
103                                                 {
104                                                     "|xns": "Roo.menu",
105                                                     "xtype": "Separator"
106                                                 },
107                                                 {
108                                                     "listeners": {
109                                                         "click": "function (_self, e)\n{\n  _this.grid.ds.load({});\n}"
110                                                     },
111                                                     "text": "Reload",
112                                                     "xtype": "Item",
113                                                     "|xns": "Roo.menu"
114                                                 }
115                                             ]
116                                         }
117                                     ]
118                                 }
119                             ]
120                         },
121                         {
122                             "xtype": "ColumnModel",
123                             "header": "Name",
124                             "width": 200,
125                             "dataIndex": "name",
126                             "|renderer": "function(v) { return String.format('{0}', v); }",
127                             "|xns": "Roo.grid",
128                             "*prop": "colModel[]"
129                         }
130                     ]
131                 }
132             ]
133         }
134     ],
135     "permname": "",
136     "modOrder": "001"
137 }