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