Pman.Dialog.Login.bjs
[Pman.BAdmin] / Pman.Tab.BAdminCompany.bjs
1 {
2  "name" : "Pman.Tab.BAdminCompany",
3  "parent" : "Pman.Tab.BAdmin",
4  "title" : "",
5  "path" : "/home/john/gitlive/web.coba/Pman/BAdmin/Pman.Tab.BAdminCompany.bjs",
6  "permname" : "",
7  "modOrder" : "002",
8  "strings" : {
9   "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
10   "231bc72756b5e6de492aaaa1577f61b1" : "Remarks",
11   "edefbda3a2bdd979e42d8944b7325b79" : "Companies",
12   "b80bb7740288fda1f201890375a60c8f" : "id",
13   "fc6f97505d89fe9277965c126744647a" : "No Companies found",
14   "694e249c3a9503141fa5ce3fb71d5477" : "<i class=\"fa fa-edit\"></i> Edit",
15   "155ca6a755e25c15ad7ce45e2f638f10" : "Displaying Companies{0} - {1} of {2}",
16   "fd5293a712d172f5c556a83c62d44bd6" : "<i class=\"fa fa-plus\"></i> Add",
17   "ed807858fcb68abdd180481f1fcba5c5" : "<i class=\"fa fa-trash\"></i> Delete",
18   "f78e208016407d8756c29673558ac14d" : "Company List",
19   "a1fa27779242b4902f7ae3bdd5c6d508" : "Type",
20   "9c9745a343efeacc9efe9b7222b27afb" : "Ref#",
21   "49ee3087348e8d44e1feda1917443987" : "Name",
22   "2e006b735fbd916d8ab26978ae6714d4" : "Tel",
23   "dd7bf230fde8d4836917806aff6a6b27" : "Address",
24   "9810aa2b9f44401be4bf73188ef2b67d" : "Fax"
25  },
26  "items" : [
27   {
28    "xtype" : "Nest",
29    "String region" : "center",
30    "$ xns" : "Roo.bootstrap.panel",
31    "String title" : "Companies",
32    "Boolean background" : false,
33    "items" : [
34     {
35      "xtype" : "Border",
36      "$ xns" : "Roo.bootstrap.layout",
37      "* prop" : "layout",
38      "items" : [
39       {
40        "String tabPosition" : "top",
41        "xtype" : "Region",
42        "$ xns" : "Roo.bootstrap.layout",
43        "* prop" : "center"
44       },
45       {
46        "listeners" : {
47         "activate" : "function (_self)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n    \n    if (_this.table) {\n        _this.table.footer.onClick('first');\n    }\n}",
48         "render" : "function (_self)\n{\n    _this.grid = _self;\n}"
49        },
50        "xtype" : "Grid",
51        "Boolean fitToFrame" : true,
52        "$ xns" : "Roo.bootstrap.panel",
53        "String region" : "center",
54        "String title" : "Company List",
55        "Boolean closable" : false,
56        "items" : [
57         {
58          "xtype" : "NavSimplebar",
59          "$ xns" : "Roo.bootstrap",
60          "* prop" : "toolbar",
61          "items" : [
62           {
63            "xtype" : "NavGroup",
64            "$ xns" : "Roo.bootstrap",
65            "items" : [
66             {
67              "xtype" : "NavItem",
68              "$ xns" : "Roo.bootstrap",
69              "items" : [
70               {
71                "xtype" : "Element",
72                "$ xns" : "Roo.bootstrap",
73                "items" : [
74                 {
75                  "String cls" : "roo-toolbar",
76                  "xtype" : "Row",
77                  "$ xns" : "Roo.bootstrap",
78                  "items" : [
79                   {
80                    "Number md" : 12,
81                    "xtype" : "Column",
82                    "$ xns" : "Roo.bootstrap",
83                    "items" : [
84                     {
85                      "listeners" : {
86                       "click" : "function (_self, e)\n{\n    Pman.Dialog.BAdminCompany.show({}, function() {\n        if (_this.table) {\n            _this.table.footer.onClick('first');\n        }\n    }); \n}"
87                      },
88                      "String cls" : "roo-toolbar-button",
89                      "String weight" : "default",
90                      "xtype" : "Button",
91                      "$ xns" : "Roo.bootstrap",
92                      "String html" : "<i class=\"fa fa-plus\"></i> Add"
93                     },
94                     {
95                      "listeners" : {
96                       "render" : "function (_self)\n{\n    _this.edit_btn = this;\n    \n    this.hide();\n}",
97                       "click" : "function (_self, e)\n{\n    var s = _this.table.getSelectionModel().getSelected();\n        \n    if (!s || s.data.id * 1 < 1)  {\n        Roo.bootstrap.MessageBox.alert(\"Error\", 'Please select a company');\n        return;\n    }\n    \n    Pman.Dialog.BAdminCompany.show({\n        id : s.data.id\n    }, function() {\n        if (_this.table) {\n            _this.table.footer.onClick('refresh');\n        }\n    });\n    \n    \n}"
98                      },
99                      "String cls" : "roo-toolbar-button",
100                      "String weight" : "default",
101                      "xtype" : "Button",
102                      "$ xns" : "Roo.bootstrap",
103                      "String html" : "<i class=\"fa fa-edit\"></i> Edit"
104                     },
105                     {
106                      "listeners" : {
107                       "render" : "function (_self)\n{\n    _this.delete_btn = this;\n    \n    this.hide();\n}",
108                       "click" : "function (_self, e)\n{\n    Pman.genericDelete(_this.grid, 'core_company'); \n}"
109                      },
110                      "String cls" : "roo-toolbar-button",
111                      "String weight" : "primary",
112                      "xtype" : "Button",
113                      "$ xns" : "Roo.bootstrap",
114                      "String html" : "<i class=\"fa fa-trash\"></i> Delete"
115                     }
116                    ]
117                   }
118                  ]
119                 }
120                ]
121               }
122              ]
123             }
124            ]
125           }
126          ]
127         },
128         {
129          "listeners" : {
130           "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n    var s = _this.table.store.getAt(rowIndex);\n    \n    if(!s || s.data.id * 1 < 1){\n        return;\n    }\n    \n    Pman.Dialog.BAdminCompany.show({\n        id : s.data.id\n    }, function() {\n        if (_this.table) {\n            _this.table.footer.onClick('refresh');\n        }\n    });\n}",
131           "render" : "function (_self)\n{\n    _this.table = this;\n}",
132           "rowclick" : "function (_self, el, rowIndex, e)\n{\n    (function(){\n        \n        _this.edit_btn.hide();\n        _this.delete_btn.hide();\n        \n        var s = _this.table.getSelectionModel().getSelected();\n        \n        if (!s || s.data.id * 1 < 1)  {\n            return;\n        }\n        \n        _this.edit_btn.show();\n        _this.delete_btn.show();\n        \n    }).defer(100);\n    \n}"
133          },
134          "String cls" : "table-fixed",
135          "boolean hover" : true,
136          "boolean striped" : false,
137          "xtype" : "Table",
138          "boolean responsive" : true,
139          "Boolean rowSelection" : true,
140          "$ xns" : "Roo.bootstrap",
141          "Boolean loadMask" : true,
142          "* prop" : "grid",
143          "items" : [
144           {
145            "Boolean singleSelect" : true,
146            "xtype" : "RowSelectionModel",
147            "$ xns" : "Roo.bootstrap.Table",
148            "* prop" : "sm"
149           },
150           {
151            "listeners" : {
152             "beforeload" : "function (_self, options)\n{\n     if (!Pman.buildCompleted) {\n        return false;\n    }\n    \n    options.params = options.params || {};\n}",
153             "load" : "function (_self, records, options)\n{\n    _this.delete_btn.hide();\n    _this.edit_btn.hide();\n}"
154            },
155            "boolean hover" : true,
156            "boolean striped" : true,
157            "xtype" : "Store",
158            "Boolean rowSelection" : true,
159            "$ xns" : "Roo.data",
160            "Boolean loadMask" : true,
161            "* prop" : "store",
162            "items" : [
163             {
164              "xtype" : "JsonReader",
165              "String root" : "data",
166              "$ xns" : "Roo.data",
167              "String id" : "id",
168              "* prop" : "reader",
169              "String totalProperty" : "total"
170             },
171             {
172              "listeners" : {
173               "load" : "function (This, o, arg)\n{\n    _this.table.footer.onClick('first');\n}"
174              },
175              "xtype" : "HttpProxy",
176              "$ xns" : "Roo.data",
177              "String method" : "GET",
178              "* prop" : "proxy",
179              "$ String url" : "baseURL + '/Roo/core_company'"
180             }
181            ]
182           },
183           {
184            "String header" : "Type",
185            "String cursor" : "pointer",
186            "String dataIndex" : "comptype",
187            "Number md" : 1,
188            "xtype" : "ColumnModel",
189            "Number xs" : 1,
190            "$ xns" : "Roo.grid",
191            "$ renderer" : "function (v,x ,r) {\n    //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n    return v;\n}",
192            "Boolean sortable" : true,
193            "* prop" : "cm[]",
194            "Number sm" : 1
195           },
196           {
197            "String header" : "Ref#",
198            "String cursor" : "pointer",
199            "String dataIndex" : "code",
200            "xtype" : "ColumnModel",
201            "$ xns" : "Roo.grid",
202            "$ renderer" : "function(v) { return String.format('{0}', v); }",
203            "Boolean sortable" : true,
204            "* prop" : "cm[]",
205            "Boolean hidden" : true
206           },
207           {
208            "String header" : "Name",
209            "String cursor" : "pointer",
210            "String dataIndex" : "name",
211            "Number md" : 2,
212            "xtype" : "ColumnModel",
213            "Number xs" : 2,
214            "$ xns" : "Roo.grid",
215            "$ renderer" : "function(v,x,r) {\n    return String.format(r.data.comptype == 'OWNER' ? '<B>{0}</B>' : '{0}',v);    \n}",
216            "Boolean sortable" : true,
217            "* prop" : "cm[]",
218            "Number sm" : 2
219           },
220           {
221            "String header" : "Tel",
222            "String cursor" : "pointer",
223            "String dataIndex" : "tel",
224            "Number md" : 1,
225            "xtype" : "ColumnModel",
226            "Number xs" : 1,
227            "$ xns" : "Roo.grid",
228            "$ renderer" : "function(v) { return String.format('{0}', v); }",
229            "* prop" : "cm[]",
230            "Number sm" : 1
231           },
232           {
233            "String header" : "Fax",
234            "String cursor" : "pointer",
235            "String dataIndex" : "fax",
236            "Number md" : 1,
237            "xtype" : "ColumnModel",
238            "Number xs" : 1,
239            "$ xns" : "Roo.grid",
240            "$ renderer" : "function(v) { return String.format('{0}', v); }",
241            "* prop" : "cm[]",
242            "Number sm" : 1
243           },
244           {
245            "String header" : "Email",
246            "String cursor" : "pointer",
247            "String dataIndex" : "email",
248            "Number md" : 2,
249            "xtype" : "ColumnModel",
250            "Number xs" : 2,
251            "$ xns" : "Roo.grid",
252            "$ renderer" : "function (v) {\n        return (v.length && v.indexOf('@') > 0 ) ? \n            String.format('<a href=\"mailto:{0}\">{0}</a>',v) : v;\n            \n    }",
253            "Boolean sortable" : true,
254            "* prop" : "cm[]",
255            "Number sm" : 2
256           },
257           {
258            "String header" : "Address",
259            "String cursor" : "pointer",
260            "String dataIndex" : "address",
261            "Number md" : 5,
262            "xtype" : "ColumnModel",
263            "Number xs" : 5,
264            "$ xns" : "Roo.grid",
265            "$ renderer" : "function(v) { return String.format('{0}', v); }",
266            "Boolean sortable" : true,
267            "* prop" : "cm[]",
268            "Number sm" : 5
269           },
270           {
271            "String header" : "Remarks",
272            "String cursor" : "pointer",
273            "String dataIndex" : "remarks",
274            "Number width" : 200,
275            "xtype" : "ColumnModel",
276            "$ xns" : "Roo.grid",
277            "$ renderer" : "function(v) { return String.format('{0}', v); }",
278            "* prop" : "cm[]",
279            "Boolean hidden" : true
280           },
281           {
282            "String header" : "id",
283            "String cursor" : "pointer",
284            "String dataIndex" : "id",
285            "Number width" : 50,
286            "xtype" : "ColumnModel",
287            "$ xns" : "Roo.grid",
288            "$ renderer" : "function(v) { return String.format('{0}', v); }",
289            "Boolean sortable" : true,
290            "* prop" : "cm[]",
291            "Boolean hidden" : true
292           },
293           {
294            "listeners" : {
295             "render" : "function (_self)\n{\n    _this.footer = _self;\n}"
296            },
297            "Number pageSize" : 25,
298            "Boolean displayInfo" : false,
299            "String displayMsg" : "Displaying Companies{0} - {1} of {2}",
300            "xtype" : "PagingToolbar",
301            "String emptyMsg" : "No Companies found",
302            "$ xns" : "Roo.bootstrap",
303            "* prop" : "footer",
304            "string name" : "footer"
305           }
306          ]
307         }
308        ]
309       }
310      ]
311     }
312    ]
313   }
314  ]
315 }