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