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