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             "|xns": "Roo",
10             "xtype": "NestedLayoutPanel",
11             "items": [
12                 {
13                     "|xns": "Roo",
14                     "xtype": "BorderLayout",
15                     "*prop": "layout",
16                     "items": [
17                         {
18                             "|xns": "Roo",
19                             "xtype": "LayoutRegion",
20                             "*prop": "center"
21                         },
22                         {
23                             "*prop": "south",
24                             "xtype": "LayoutRegion",
25                             "|xns": "Roo"
26                         },
27                         {
28                             "|xns": "Roo",
29                             "xtype": "GridPanel",
30                             "title": "Companies",
31                             "fitToframe": true,
32                             "fitContainer": true,
33                             "tableName": "Companies",
34                             "background": true,
35                             "region": "center",
36                             "listeners": {
37                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
38                             },
39                             "items": [
40                                 {
41                                     "listeners": {
42                                         "|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}",
43                                         "|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"
44                                     },
45                                     "*prop": "grid",
46                                     "autoExpandColumn": "name",
47                                     "loadMask": true,
48                                     "xtype": "Grid",
49                                     "|xns": "Roo.grid",
50                                     "items": [
51                                         {
52                                             "listeners": {
53                                                 "load": "function (_self, records, options)\n{\n   try {\n        Pman.Tab.Office.grid.footer.onClick('refresh');\n    } catch (e) {}\n}"
54                                             },
55                                             "*prop": "dataSource",
56                                             "remoteSort": true,
57                                             "xtype": "Store",
58                                             "|sortInfo": "{ field : 'code', direction: 'ASC' }",
59                                             "|xns": "Roo.data",
60                                             "items": [
61                                                 {
62                                                     "listeners": {
63                                                         "load": "function (This, o, arg)\n{\n \n}"
64                                                     },
65                                                     "*prop": "proxy",
66                                                     "method": "GET",
67                                                     "xtype": "HttpProxy",
68                                                     "|url": "baseURL + '/Roo/Companies.php'",
69                                                     "|xns": "Roo.data"
70                                                 },
71                                                 {
72                                                     "|xns": "Roo.data",
73                                                     "xtype": "JsonReader",
74                                                     "totalProperty": "total",
75                                                     "root": "data",
76                                                     "*prop": "reader",
77                                                     "id": "id",
78                                                     "|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]"
79                                                 }
80                                             ]
81                                         },
82                                         {
83                                             "*prop": "footer",
84                                             "xtype": "PagingToolbar",
85                                             "pageSize": 25,
86                                             "displayInfo": true,
87                                             "displayMsg": "Displaying Companies{0} - {1} of {2}",
88                                             "emptyMsg": "No Companies found",
89                                             "|xns": "Roo"
90                                         },
91                                         {
92                                             "*prop": "toolbar",
93                                             "xtype": "Toolbar",
94                                             "|xns": "Roo",
95                                             "items": [
96                                                 {
97                                                     "text": "Add",
98                                                     "xtype": "Button",
99                                                     "cls": "x-btn-text-icon",
100                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
101                                                     "listeners": {
102                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
103                                                     },
104                                                     "|xns": "Roo.Toolbar"
105                                                 },
106                                                 {
107                                                     "text": "Edit",
108                                                     "xtype": "Button",
109                                                     "cls": "x-btn-text-icon",
110                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
111                                                     "listeners": {
112                                                         "|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"
113                                                     },
114                                                     "|xns": "Roo.Toolbar"
115                                                 },
116                                                 {
117                                                     "text": "Delete",
118                                                     "cls": "x-btn-text-icon",
119                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
120                                                     "xtype": "Button",
121                                                     "listeners": {
122                                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'Companies'); \n}\n        "
123                                                     },
124                                                     "|xns": "Roo.Toolbar"
125                                                 }
126                                             ]
127                                         },
128                                         {
129                                             "*prop": "colModel[]",
130                                             "dataIndex": "comptype",
131                                             "header": "Type",
132                                             "sortable": true,
133                                             "width": 90,
134                                             "xtype": "ColumnModel",
135                                             "|renderer": "function (v,x ,r) {\n    return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n}",
136                                             "|xns": "Roo.grid"
137                                         },
138                                         {
139                                             "*prop": "colModel[]",
140                                             "dataIndex": "code",
141                                             "header": "Ref#",
142                                             "width": 50,
143                                             "xtype": "ColumnModel",
144                                             "|renderer": "function(v) { return String.format('{0}', v); }",
145                                             "|xns": "Roo.grid"
146                                         },
147                                         {
148                                             "*prop": "colModel[]",
149                                             "dataIndex": "name",
150                                             "header": "Name",
151                                             "width": 200,
152                                             "xtype": "ColumnModel",
153                                             "|renderer": "function(v,x,r) {\n    return String.format(r.data.isOwner ? '<B>{0}</B>' : '{0}',v);    \n}",
154                                             "|xns": "Roo.grid"
155                                         },
156                                         {
157                                             "*prop": "colModel[]",
158                                             "dataIndex": "tel",
159                                             "header": "Tel",
160                                             "width": 100,
161                                             "xtype": "ColumnModel",
162                                             "|renderer": "function(v) { return String.format('{0}', v); }",
163                                             "|xns": "Roo.grid"
164                                         },
165                                         {
166                                             "*prop": "colModel[]",
167                                             "dataIndex": "fax",
168                                             "header": "Fax",
169                                             "width": 100,
170                                             "xtype": "ColumnModel",
171                                             "|renderer": "function(v) { return String.format('{0}', v); }",
172                                             "|xns": "Roo.grid"
173                                         },
174                                         {
175                                             "*prop": "colModel[]",
176                                             "dataIndex": "email",
177                                             "header": "Email",
178                                             "width": 100,
179                                             "xtype": "ColumnModel",
180                                             "|renderer": " function (v) {\n        return (v.length && v.indexOf('@') > 0 ) ? \n            String.format('<a href=\"mailto:{0}\">{0}</a>',v) : v;\n            \n    }",
181                                             "|xns": "Roo.grid"
182                                         },
183                                         {
184                                             "xtype": "ColumnModel",
185                                             "header": "Address",
186                                             "width": 200,
187                                             "dataIndex": "address",
188                                             "|renderer": "function(v) { return String.format('{0}', v); }",
189                                             "|xns": "Roo.grid",
190                                             "*prop": "colModel[]"
191                                         },
192                                         {
193                                             "xtype": "ColumnModel",
194                                             "header": "Remarks",
195                                             "width": 200,
196                                             "dataIndex": "remarks",
197                                             "|renderer": "function(v) { return String.format('{0}', v); }",
198                                             "|xns": "Roo.grid",
199                                             "*prop": "colModel[]"
200                                         }
201                                     ]
202                                 }
203                             ]
204                         }
205                     ]
206                 }
207             ]
208         }
209     ],
210     "permname": "",
211     "modOrder": "001"
212 }