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                     "enableDrop": true,
30                     "loadMask": true,
31                     "xtype": "Grid",
32                     "|xns": "Roo.grid",
33                     "items": [
34                         {
35                             "*prop": "dataSource",
36                             "xtype": "Store",
37                             "remoteSort": true,
38                             "|sortInfo": "{ field : 'name', direction: 'ASC' }",
39                             "|xns": "Roo.data",
40                             "items": [
41                                 {
42                                     "*prop": "proxy",
43                                     "xtype": "HttpProxy",
44                                     "method": "GET",
45                                     "|url": "baseURL + '/Roo/Groups.php'",
46                                     "|xns": "Roo.data"
47                                 },
48                                 {
49                                     "|xns": "Roo.data",
50                                     "xtype": "JsonReader",
51                                     "totalProperty": "total",
52                                     "root": "data",
53                                     "*prop": "reader",
54                                     "id": "id",
55                                     "|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]"
56                                 }
57                             ]
58                         },
59                         {
60                             "*prop": "toolbar",
61                             "xtype": "Toolbar",
62                             "|xns": "Roo",
63                             "items": [
64                                 {
65                                     "text": "Manage Groups",
66                                     "xtype": "Button",
67                                     "|xns": "Roo.Toolbar",
68                                     "items": [
69                                         {
70                                             "|xns": "Roo.menu",
71                                             "xtype": "Menu",
72                                             "*prop": "menu",
73                                             "items": [
74                                                 {
75                                                     "listeners": {
76                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n         _this.grid.ds.load({});\n   }); \n}\n"
77                                                     },
78                                                     "cls": "x-btn-text-icon",
79                                                     "text": "Add",
80                                                     "xtype": "Item",
81                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
82                                                     "|xns": "Roo.menu"
83                                                 },
84                                                 {
85                                                     "listeners": {
86                                                         "|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"
87                                                     },
88                                                     "cls": "x-btn-text-icon",
89                                                     "text": "Edit",
90                                                     "xtype": "Item",
91                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
92                                                     "|xns": "Roo.menu"
93                                                 },
94                                                 {
95                                                     "listeners": {
96                                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'Groups'); \n}\n        "
97                                                     },
98                                                     "cls": "x-btn-text-icon",
99                                                     "text": "Delete",
100                                                     "xtype": "Item",
101                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
102                                                     "|xns": "Roo.menu"
103                                                 },
104                                                 {
105                                                     "|xns": "Roo.menu",
106                                                     "xtype": "Separator"
107                                                 },
108                                                 {
109                                                     "listeners": {
110                                                         "click": "function (_self, e)\n{\n  _this.grid.ds.load({});\n}"
111                                                     },
112                                                     "text": "Reload",
113                                                     "xtype": "Item",
114                                                     "|xns": "Roo.menu"
115                                                 }
116                                             ]
117                                         }
118                                     ]
119                                 }
120                             ]
121                         },
122                         {
123                             "xtype": "ColumnModel",
124                             "header": "Name",
125                             "width": 200,
126                             "dataIndex": "name",
127                             "|renderer": "function(v) { return String.format('{0}', v); }",
128                             "|xns": "Roo.grid",
129                             "*prop": "colModel[]"
130                         }
131                     ]
132                 }
133             ]
134         }
135     ],
136     "permname": "",
137     "modOrder": "001"
138 }