Pman.Tab.AdminCompanies.bjs
[Pman.Admin] / Pman.Tab.AdminCompanies.bjs
1 {
2     "id": "roo-file-1",
3     "name": "Pman.Tab.AdminCompanies",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminCompanies.bjs",
7     "items": [
8         {
9             "title": "Companies",
10             "xtype": "NestedLayoutPanel",
11             "|xns": "Roo",
12             "items": [
13                 {
14                     "|xns": "Roo",
15                     "xtype": "BorderLayout",
16                     "*prop": "layout",
17                     "items": [
18                         {
19                             "|xns": "Roo",
20                             "xtype": "LayoutRegion",
21                             "*prop": "center"
22                         },
23                         {
24                             "*prop": "south",
25                             "xtype": "LayoutRegion",
26                             "|xns": "Roo"
27                         },
28                         {
29                             "|xns": "Roo",
30                             "xtype": "GridPanel",
31                             "title": "Companies",
32                             "fitToframe": true,
33                             "fitContainer": true,
34                             "tableName": "Companies",
35                             "background": true,
36                             "region": "center",
37                             "listeners": {
38                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
39                             },
40                             "items": [
41                                 {
42                                     "listeners": {
43                                         "|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}",
44                                         "|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"
45                                     },
46                                     "*prop": "grid",
47                                     "autoExpandColumn": "name",
48                                     "loadMask": true,
49                                     "xtype": "Grid",
50                                     "|xns": "Roo.grid",
51                                     "items": [
52                                         {
53                                             "listeners": {
54                                                 "load": "function (_self, records, options)\n{\n   try {\n        Pman.Tab.Office.grid.footer.onClick('refresh');\n    } catch (e) {}\n}"
55                                             },
56                                             "*prop": "dataSource",
57                                             "remoteSort": true,
58                                             "xtype": "Store",
59                                             "|sortInfo": "{ field : 'code', direction: 'ASC' }",
60                                             "|xns": "Roo.data",
61                                             "items": [
62                                                 {
63                                                     "listeners": {
64                                                         "load": "function (This, o, arg)\n{\n \n}"
65                                                     },
66                                                     "*prop": "proxy",
67                                                     "method": "GET",
68                                                     "xtype": "HttpProxy",
69                                                     "|url": "baseURL + '/Roo/Companies.php'",
70                                                     "|xns": "Roo.data"
71                                                 },
72                                                 {
73                                                     "|xns": "Roo.data",
74                                                     "xtype": "JsonReader",
75                                                     "totalProperty": "total",
76                                                     "root": "data",
77                                                     "*prop": "reader",
78                                                     "id": "id",
79                                                     "|fields": "[\n    {\n        'name': 'code',\n        'type': 'string'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'address',\n        'type': 'string'\n    },\n    {\n        'name': 'tel',\n        'type': 'string'\n    },\n    {\n        'name': 'fax',\n        'type': 'string'\n    },\n    {\n        'name': 'email',\n        'type': 'string'\n    },\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'isOwner',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id',\n        'type': 'int'\n    },\n    {\n        'name': 'background_color',\n        'type': 'string'\n    },\n    {\n        'name': 'comptype',\n        'type': 'string'\n    },\n    {\n        'name': 'url',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created_by',\n        'type': 'int'\n    },\n    {\n        'name': 'created_dt',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'updated_by',\n        'type': 'int'\n    },\n    {\n        'name': 'updated_dt',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'dispatch_port',\n        'type': 'string'\n    },\n    {\n        'name': 'province',\n        'type': 'string'\n    },\n    {\n        'name': 'country',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_filename',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_onid',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_width',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_height',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_language',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_created',\n        'type': 'date'\n    },\n    {\n        'name': 'logo_id_imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_descript',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_title',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_deleted_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'main_office_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'main_office_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'main_office_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id_address',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id_role',\n        'type': 'string'\n    }\n]"
80                                                 }
81                                             ]
82                                         },
83                                         {
84                                             "*prop": "footer",
85                                             "xtype": "PagingToolbar",
86                                             "pageSize": 25,
87                                             "displayInfo": true,
88                                             "displayMsg": "Displaying Companies{0} - {1} of {2}",
89                                             "emptyMsg": "No Companies found",
90                                             "|xns": "Roo"
91                                         },
92                                         {
93                                             "*prop": "toolbar",
94                                             "xtype": "Toolbar",
95                                             "|xns": "Roo",
96                                             "items": [
97                                                 {
98                                                     "listeners": {
99                                                         "show": "function (_self)\n{\n_this.searchBox = _self;\n}"
100                                                     },
101                                                     "xtype": "TextField",
102                                                     "|xns": "Roo.form"
103                                                 },
104                                                 {
105                                                     "listeners": {
106                                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
107                                                     },
108                                                     "cls": "x-btn-icon",
109                                                     "xtype": "Button",
110                                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
111                                                     "|xns": "Roo.Toolbar"
112                                                 },
113                                                 {
114                                                     "listeners": {
115                                                         "|click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\n    _this.grid.footer.onClick('first');\n}"
116                                                     },
117                                                     "cls": "x-btn-icon",
118                                                     "xtype": "Button",
119                                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
120                                                     "|xns": "Roo.Toolbar"
121                                                 },
122                                                 {
123                                                     "|xns": "Roo.Toolbar",
124                                                     "xtype": "Fill"
125                                                 },
126                                                 {
127                                                     "text": "Add",
128                                                     "xtype": "Button",
129                                                     "cls": "x-btn-text-icon",
130                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
131                                                     "listeners": {
132                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
133                                                     },
134                                                     "|xns": "Roo.Toolbar"
135                                                 },
136                                                 {
137                                                     "text": "Edit",
138                                                     "xtype": "Button",
139                                                     "cls": "x-btn-text-icon",
140                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
141                                                     "listeners": {
142                                                         "|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"
143                                                     },
144                                                     "|xns": "Roo.Toolbar"
145                                                 },
146                                                 {
147                                                     "text": "Delete",
148                                                     "cls": "x-btn-text-icon",
149                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
150                                                     "xtype": "Button",
151                                                     "listeners": {
152                                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'Companies'); \n}\n        "
153                                                     },
154                                                     "|xns": "Roo.Toolbar"
155                                                 }
156                                             ]
157                                         },
158                                         {
159                                             "*prop": "colModel[]",
160                                             "dataIndex": "comptype",
161                                             "header": "Type",
162                                             "sortable": true,
163                                             "width": 90,
164                                             "xtype": "ColumnModel",
165                                             "|renderer": "function (v,x ,r) {\n    return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n}",
166                                             "|xns": "Roo.grid"
167                                         },
168                                         {
169                                             "*prop": "colModel[]",
170                                             "dataIndex": "code",
171                                             "header": "Ref#",
172                                             "width": 50,
173                                             "xtype": "ColumnModel",
174                                             "|renderer": "function(v) { return String.format('{0}', v); }",
175                                             "|xns": "Roo.grid"
176                                         },
177                                         {
178                                             "*prop": "colModel[]",
179                                             "dataIndex": "name",
180                                             "header": "Name",
181                                             "width": 200,
182                                             "xtype": "ColumnModel",
183                                             "|renderer": "function(v,x,r) {\n    return String.format(r.data.isOwner ? '<B>{0}</B>' : '{0}',v);    \n}",
184                                             "|xns": "Roo.grid"
185                                         },
186                                         {
187                                             "*prop": "colModel[]",
188                                             "dataIndex": "tel",
189                                             "header": "Tel",
190                                             "width": 100,
191                                             "xtype": "ColumnModel",
192                                             "|renderer": "function(v) { return String.format('{0}', v); }",
193                                             "|xns": "Roo.grid"
194                                         },
195                                         {
196                                             "*prop": "colModel[]",
197                                             "dataIndex": "fax",
198                                             "header": "Fax",
199                                             "width": 100,
200                                             "xtype": "ColumnModel",
201                                             "|renderer": "function(v) { return String.format('{0}', v); }",
202                                             "|xns": "Roo.grid"
203                                         },
204                                         {
205                                             "*prop": "colModel[]",
206                                             "dataIndex": "email",
207                                             "header": "Email",
208                                             "width": 100,
209                                             "xtype": "ColumnModel",
210                                             "|renderer": " function (v) {\n        return (v.length && v.indexOf('@') > 0 ) ? \n            String.format('<a href=\"mailto:{0}\">{0}</a>',v) : v;\n            \n    }",
211                                             "|xns": "Roo.grid"
212                                         },
213                                         {
214                                             "xtype": "ColumnModel",
215                                             "header": "Address",
216                                             "width": 200,
217                                             "dataIndex": "address",
218                                             "|renderer": "function(v) { return String.format('{0}', v); }",
219                                             "|xns": "Roo.grid",
220                                             "*prop": "colModel[]"
221                                         },
222                                         {
223                                             "xtype": "ColumnModel",
224                                             "header": "Remarks",
225                                             "width": 200,
226                                             "dataIndex": "remarks",
227                                             "|renderer": "function(v) { return String.format('{0}', v); }",
228                                             "|xns": "Roo.grid",
229                                             "*prop": "colModel[]"
230                                         }
231                                     ]
232                                 }
233                             ]
234                         }
235                     ]
236                 }
237             ]
238         }
239     ],
240     "permname": "",
241     "modOrder": "001"
242 }