Pman.Tab.BAdminCompany.bjs
[Pman.BAdmin] / Pman.Tab.BAdminCompany.bjs
1 {
2  "name" : "Pman.Tab.BAdminCompany",
3  "parent" : "Pman.Tab.BAdmin",
4  "title" : "",
5  "path" : "/home/edward/gitlive/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    "$ xns" : "Roo.bootstrap.panel",
30    "String region" : "center",
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              "String style" : "float: left",
70              "items" : [
71               {
72                "listeners" : {
73                 "click" : "function (_self, e)\n{\n    Pman.Dialog.BAdminCompany.show({}, function() {\n        if (_this.table) {\n            _this.table.footer.onClick('first');\n        }\n    }); \n}"
74                },
75                "String weight" : "default",
76                "xtype" : "Button",
77                "$ xns" : "Roo.bootstrap",
78                "String html" : "<i class=\"fa fa-plus\"></i> Add",
79                "String style" : "margin: 10px;"
80               },
81               {
82                "listeners" : {
83                 "render" : "function (_self)\n{\n    _this.edit_btn = this;\n    \n    this.hide();\n}",
84                 "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}"
85                },
86                "String weight" : "default",
87                "xtype" : "Button",
88                "$ xns" : "Roo.bootstrap",
89                "String html" : "<i class=\"fa fa-edit\"></i> Edit",
90                "String style" : "margin: 10px;"
91               },
92               {
93                "listeners" : {
94                 "render" : "function (_self)\n{\n    _this.delete_btn = this;\n    \n    this.hide();\n}",
95                 "click" : "function (_self, e)\n{\n    Pman.genericDelete(_this.grid, 'core_company'); \n}"
96                },
97                "String weight" : "primary",
98                "xtype" : "Button",
99                "$ xns" : "Roo.bootstrap",
100                "String html" : "<i class=\"fa fa-trash\"></i> Delete",
101                "String style" : "margin: 10px;"
102               }
103              ]
104             }
105            ]
106           }
107          ]
108         },
109         {
110          "listeners" : {
111           "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}",
112           "render" : "function (_self)\n{\n    _this.table = this;\n}",
113           "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}"
114          },
115          "String cls" : "table-fixed",
116          "boolean striped" : false,
117          "boolean hover" : true,
118          "xtype" : "Table",
119          "boolean responsive" : true,
120          "Boolean rowSelection" : true,
121          "$ xns" : "Roo.bootstrap",
122          "Boolean loadMask" : true,
123          "* prop" : "grid",
124          "items" : [
125           {
126            "Boolean singleSelect" : true,
127            "xtype" : "RowSelectionModel",
128            "$ xns" : "Roo.bootstrap.Table",
129            "* prop" : "sm"
130           },
131           {
132            "listeners" : {
133             "beforeload" : "function (_self, options)\n{\n    options.params = options.params || {};\n}",
134             "load" : "function (_self, records, options)\n{\n    _this.delete_btn.hide();\n    _this.edit_btn.hide();\n}"
135            },
136            "boolean hover" : true,
137            "boolean striped" : true,
138            "xtype" : "Store",
139            "Boolean rowSelection" : true,
140            "$ xns" : "Roo.data",
141            "Boolean loadMask" : true,
142            "* prop" : "store",
143            "items" : [
144             {
145              "xtype" : "JsonReader",
146              "String root" : "data",
147              "$ xns" : "Roo.data",
148              "String id" : "id",
149              "* prop" : "reader",
150              "String totalProperty" : "total"
151             },
152             {
153              "listeners" : {
154               "load" : "function (This, o, arg)\n{\n    _this.table.footer.onClick('first');\n}"
155              },
156              "xtype" : "HttpProxy",
157              "$ xns" : "Roo.data",
158              "String method" : "GET",
159              "* prop" : "proxy",
160              "$ String url" : "baseURL + '/Roo/core_company'"
161             }
162            ]
163           },
164           {
165            "String header" : "Type",
166            "String cursor" : "pointer",
167            "String dataIndex" : "comptype",
168            "Number md" : 1,
169            "xtype" : "ColumnModel",
170            "Number xs" : 1,
171            "$ xns" : "Roo.grid",
172            "$ renderer" : "function (v,x ,r) {\n    //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n    return v;\n}",
173            "Boolean sortable" : true,
174            "* prop" : "cm[]",
175            "Number sm" : 1
176           },
177           {
178            "String header" : "Ref#",
179            "String cursor" : "pointer",
180            "String dataIndex" : "code",
181            "xtype" : "ColumnModel",
182            "$ xns" : "Roo.grid",
183            "$ renderer" : "function(v) { return String.format('{0}', v); }",
184            "Boolean sortable" : true,
185            "* prop" : "cm[]",
186            "Boolean hidden" : true
187           },
188           {
189            "String header" : "Name",
190            "String cursor" : "pointer",
191            "String dataIndex" : "name",
192            "Number md" : 2,
193            "xtype" : "ColumnModel",
194            "Number xs" : 2,
195            "$ xns" : "Roo.grid",
196            "$ renderer" : "function(v,x,r) {\n    return String.format(r.data.comptype == 'OWNER' ? '<B>{0}</B>' : '{0}',v);    \n}",
197            "Boolean sortable" : true,
198            "* prop" : "cm[]",
199            "Number sm" : 2
200           },
201           {
202            "String header" : "Tel",
203            "String cursor" : "pointer",
204            "String dataIndex" : "tel",
205            "Number md" : 1,
206            "xtype" : "ColumnModel",
207            "Number xs" : 1,
208            "$ xns" : "Roo.grid",
209            "$ renderer" : "function(v) { return String.format('{0}', v); }",
210            "* prop" : "cm[]",
211            "Number sm" : 1
212           },
213           {
214            "String header" : "Fax",
215            "String cursor" : "pointer",
216            "String dataIndex" : "fax",
217            "Number md" : 1,
218            "xtype" : "ColumnModel",
219            "Number xs" : 1,
220            "$ xns" : "Roo.grid",
221            "$ renderer" : "function(v) { return String.format('{0}', v); }",
222            "* prop" : "cm[]",
223            "Number sm" : 1
224           },
225           {
226            "String header" : "Email",
227            "String cursor" : "pointer",
228            "String dataIndex" : "email",
229            "Number md" : 2,
230            "xtype" : "ColumnModel",
231            "Number xs" : 2,
232            "$ xns" : "Roo.grid",
233            "$ renderer" : "function (v) {\n        return (v.length && v.indexOf('@') > 0 ) ? \n            String.format('<a href=\"mailto:{0}\">{0}</a>',v) : v;\n            \n    }",
234            "Boolean sortable" : true,
235            "* prop" : "cm[]",
236            "Number sm" : 2
237           },
238           {
239            "String header" : "Address",
240            "String cursor" : "pointer",
241            "String dataIndex" : "address",
242            "Number md" : 5,
243            "xtype" : "ColumnModel",
244            "Number xs" : 5,
245            "$ xns" : "Roo.grid",
246            "$ renderer" : "function(v) { return String.format('{0}', v); }",
247            "Boolean sortable" : true,
248            "* prop" : "cm[]",
249            "Number sm" : 5
250           },
251           {
252            "String header" : "Remarks",
253            "String cursor" : "pointer",
254            "String dataIndex" : "remarks",
255            "Number width" : 200,
256            "xtype" : "ColumnModel",
257            "$ xns" : "Roo.grid",
258            "$ renderer" : "function(v) { return String.format('{0}', v); }",
259            "* prop" : "cm[]",
260            "Boolean hidden" : true
261           },
262           {
263            "String header" : "id",
264            "String cursor" : "pointer",
265            "String dataIndex" : "id",
266            "Number width" : 50,
267            "xtype" : "ColumnModel",
268            "$ xns" : "Roo.grid",
269            "$ renderer" : "function(v) { return String.format('{0}', v); }",
270            "Boolean sortable" : true,
271            "* prop" : "cm[]",
272            "Boolean hidden" : true
273           },
274           {
275            "listeners" : {
276             "render" : "function (_self)\n{\n    _this.footer = _self;\n}"
277            },
278            "Number pageSize" : 25,
279            "String displayMsg" : "Displaying Companies{0} - {1} of {2}",
280            "Boolean displayInfo" : false,
281            "xtype" : "PagingToolbar",
282            "String emptyMsg" : "No Companies found",
283            "$ xns" : "Roo.bootstrap",
284            "* prop" : "footer",
285            "string name" : "footer"
286           }
287          ]
288         }
289        ]
290       }
291      ]
292     }
293    ]
294   }
295  ]
296 }