Pman.Tab.AdminOffice.bjs
[Pman.Admin] / Pman.Tab.AdminOffice.bjs
1 {
2     "id": "roo-file-8",
3     "name": "Pman.Tab.AdminOffice",
4     "parent": "Pman.Tab.AdminCompanies",
5     "title": "Pman.Tab.AdminOffice",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminOffice.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "Office",
17             "title": "Offices / Departments / Sub-Companies",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
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                             "listeners": {
34                                 "beforeload": "function (_self, o)\n{\n    try {\n        var sm = Pman.Tab.Companies.grid.getSelectionModel();\n        sm = sm.getSelected();\n        if (!sm || !sm.data.id) {\n            // mask??\n            return false;\n        }\n               \n        o.params.company_id = sm.data.id ;\n    } catch (e) {\n        return false;\n    }\n    \n }"
35                             },
36                             "*prop": "dataSource",
37                             "remoteSort": true,
38                             "xtype": "Store",
39                             "|sortInfo": "{ field : 'name', direction: 'ASC' }",
40                             "|xns": "Roo.data",
41                             "items": [
42                                 {
43                                     "*prop": "proxy",
44                                     "xtype": "HttpProxy",
45                                     "method": "GET",
46                                     "|url": "baseURL + '/Roo/Office.php'",
47                                     "|xns": "Roo.data"
48                                 },
49                                 {
50                                     "|xns": "Roo.data",
51                                     "xtype": "JsonReader",
52                                     "totalProperty": "total",
53                                     "root": "data",
54                                     "*prop": "reader",
55                                     "id": "id",
56                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'address',\n        'type': 'string'\n    },\n    {\n        'name': 'phone',\n        'type': 'string'\n    },\n    {\n        'name': 'fax',\n        'type': 'string'\n    },\n    {\n        'name': 'email',\n        'type': 'string'\n    },\n    {\n        'name': 'role',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_code',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_address',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_tel',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_isOwner',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_logo_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_background_color',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_comptype',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_url',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_main_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_created_by',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_created_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'company_id_updated_by',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_updated_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'company_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_dispatch_port',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_province',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_country',\n        'type': 'string'\n    }\n]"
57                                 }
58                             ]
59                         },
60                         {
61                             "*prop": "footer",
62                             "xtype": "PagingToolbar",
63                             "pageSize": 25,
64                             "displayInfo": true,
65                             "displayMsg": "Displaying Office{0} - {1} of {2}",
66                             "emptyMsg": "No Office found",
67                             "|xns": "Roo"
68                         },
69                         {
70                             "*prop": "toolbar",
71                             "xtype": "Toolbar",
72                             "|xns": "Roo",
73                             "items": [
74                                 {
75                                     "text": "Add",
76                                     "xtype": "Button",
77                                     "cls": "x-btn-text-icon",
78                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
79                                     "listeners": {
80                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
81                                     },
82                                     "|xns": "Roo.Toolbar"
83                                 },
84                                 {
85                                     "text": "Edit",
86                                     "xtype": "Button",
87                                     "cls": "x-btn-text-icon",
88                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
89                                     "listeners": {
90                                         "|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"
91                                     },
92                                     "|xns": "Roo.Toolbar"
93                                 },
94                                 {
95                                     "text": "Delete",
96                                     "cls": "x-btn-text-icon",
97                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
98                                     "xtype": "Button",
99                                     "listeners": {
100                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'Office'); \n}\n        "
101                                     },
102                                     "|xns": "Roo.Toolbar"
103                                 }
104                             ]
105                         },
106                         {
107                             "xtype": "ColumnModel",
108                             "header": "Company",
109                             "width": 75,
110                             "dataIndex": "company_id",
111                             "|renderer": "function(v) { return String.format('{0}', v); }",
112                             "|xns": "Roo.grid",
113                             "*prop": "colModel[]"
114                         },
115                         {
116                             "xtype": "ColumnModel",
117                             "header": "Name",
118                             "width": 200,
119                             "dataIndex": "name",
120                             "|renderer": "function(v) { return String.format('{0}', v); }",
121                             "|xns": "Roo.grid",
122                             "*prop": "colModel[]"
123                         },
124                         {
125                             "xtype": "ColumnModel",
126                             "header": "Address",
127                             "width": 200,
128                             "dataIndex": "address",
129                             "|renderer": "function(v) { return String.format('{0}', v); }",
130                             "|xns": "Roo.grid",
131                             "*prop": "colModel[]"
132                         },
133                         {
134                             "xtype": "ColumnModel",
135                             "header": "Phone",
136                             "width": 200,
137                             "dataIndex": "phone",
138                             "|renderer": "function(v) { return String.format('{0}', v); }",
139                             "|xns": "Roo.grid",
140                             "*prop": "colModel[]"
141                         },
142                         {
143                             "xtype": "ColumnModel",
144                             "header": "Fax",
145                             "width": 200,
146                             "dataIndex": "fax",
147                             "|renderer": "function(v) { return String.format('{0}', v); }",
148                             "|xns": "Roo.grid",
149                             "*prop": "colModel[]"
150                         },
151                         {
152                             "xtype": "ColumnModel",
153                             "header": "Email",
154                             "width": 200,
155                             "dataIndex": "email",
156                             "|renderer": "function(v) { return String.format('{0}', v); }",
157                             "|xns": "Roo.grid",
158                             "*prop": "colModel[]"
159                         },
160                         {
161                             "xtype": "ColumnModel",
162                             "header": "Role",
163                             "width": 200,
164                             "dataIndex": "role",
165                             "|renderer": "function(v) { return String.format('{0}', v); }",
166                             "|xns": "Roo.grid",
167                             "*prop": "colModel[]"
168                         }
169                     ]
170                 }
171             ]
172         }
173     ],
174     "permname": "",
175     "modOrder": "001"
176 }