Pman.Tab.BAdminCompany.bjs
[Pman.BAdmin] / Pman.Tab.BAdminCompany.bjs
1 {
2  "name" : "Pman.Tab.BAdminCompany",
3  "parent" : "Pman.Tab",
4  "title" : "",
5  "path" : "/home/khlau/gitlive/Pman.BAdmin/Pman.Tab.BAdminCompany.bjs",
6  "permname" : "",
7  "modOrder" : "002",
8  "strings" : {
9   "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
10   "231bc72756b5e6de492aaaa1577f61b1" : "Remarks",
11   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
12   "edefbda3a2bdd979e42d8944b7325b79" : "Companies",
13   "b80bb7740288fda1f201890375a60c8f" : "id",
14   "7dce122004969d56ae2e0245cb754d35" : "Edit",
15   "fc6f97505d89fe9277965c126744647a" : "No Companies found",
16   "155ca6a755e25c15ad7ce45e2f638f10" : "Displaying Companies{0} - {1} of {2}",
17   "f78e208016407d8756c29673558ac14d" : "Company List",
18   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
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    "items" : [
33     {
34      "xtype" : "Border",
35      "$ xns" : "Roo.bootstrap.layout",
36      "* prop" : "layout",
37      "items" : [
38       {
39        "xtype" : "Region",
40        "$ xns" : "Roo.bootstrap.layout",
41        "* prop" : "center"
42       },
43       {
44        "listeners" : {
45         "activate" : "function (_self)\n{\n \n    if (_this.table) {\n      _this.table.store.load({});\n      _this.dialog = Pman.Dialog.BAdminCompany;\n      }\n}",
46         "render" : "function (_self)\n{\n    _this.grid = _self;\n}"
47        },
48        "xtype" : "Grid",
49        "Boolean fitToFrame" : true,
50        "$ xns" : "Roo.bootstrap.panel",
51        "String region" : "center",
52        "String title" : "Company List",
53        "Boolean closable" : false,
54        "items" : [
55         {
56          "xtype" : "NavSimplebar",
57          "$ xns" : "Roo.bootstrap",
58          "* prop" : "toolbar",
59          "items" : [
60           {
61            "xtype" : "NavGroup",
62            "$ xns" : "Roo.bootstrap",
63            "items" : [
64             {
65              "xtype" : "NavItem",
66              "$ xns" : "Roo.bootstrap",
67              "String style" : "float: left",
68              "items" : [
69               {
70                "listeners" : {
71                 "click" : "function (_self, e)\n{\n    if (!_this.dialog) {\n        return;\n        }\n\n    _this.dialog.show({}, function() {\n        if (_this.table) {\n            _this.table.store.load({});\n        }\n    }); \n    _this.dialog.modal.setTitle('Add Company');\n    _this.dialog.form.reset();\n\n}"
72                },
73                "String weight" : "primary",
74                "xtype" : "Button",
75                "$ xns" : "Roo.bootstrap",
76                "String html" : "Add",
77                "String style" : "margin: 10px;"
78               },
79               {
80                "listeners" : {
81                 "click" : "function (_self, e)\n{\n    var s = _this.grid.grid.selModel.getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.bootstrap.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) {\n        return;\n    }\n    _this.dialog.show(s[0].data, function() {\n        if (_this.table) {\n            _this.table.store.load({});\n        }\n    }); \n    \n}"
82                },
83                "String weight" : "primary",
84                "xtype" : "Button",
85                "$ xns" : "Roo.bootstrap",
86                "String html" : "Edit",
87                "String style" : "margin: 10px;"
88               },
89               {
90                "listeners" : {
91                 "click" : "function (_self, e)\n{\n      Pman.genericDelete(_this.grid, 'core_company'); \n}"
92                },
93                "String weight" : "primary",
94                "xtype" : "Button",
95                "$ xns" : "Roo.bootstrap",
96                "String html" : "Delete",
97                "String style" : "margin: 10px;"
98               }
99              ]
100             }
101            ]
102           }
103          ]
104         },
105         {
106          "listeners" : {
107           "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n    var s = _this.grid.grid.selModel.getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.bootstrap.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) {\n        return;\n    }\n    _this.dialog.show(s[0].data, function() {\n        if (_this.table) {\n            _this.table.store.load({});\n        }\n    }); \n}",
108           "render" : "function (_self)\n{\n  _this.table = _self;\n  \n  \n  if(_this.table.active) {\n    this.footer.onClick('first');\n  }\n}"
109          },
110          "String cls" : "table-fixed",
111          "boolean hover" : true,
112          "boolean striped" : false,
113          "xtype" : "Table",
114          "boolean responsive" : true,
115          "Boolean rowSelection" : true,
116          "$ xns" : "Roo.bootstrap",
117          "Boolean loadMask" : true,
118          "* prop" : "grid",
119          "items" : [
120           {
121            "boolean hover" : true,
122            "boolean striped" : true,
123            "xtype" : "Store",
124            "Boolean rowSelection" : true,
125            "$ xns" : "Roo.data",
126            "Boolean loadMask" : true,
127            "* prop" : "store",
128            "items" : [
129             {
130              "xtype" : "JsonReader",
131              "String root" : "data",
132              "$ xns" : "Roo.data",
133              "String id" : "id",
134              "* prop" : "reader",
135              "String totalProperty" : "total"
136             },
137             {
138              "listeners" : {
139               "load" : "function (This, o, arg)\n{\n    _this.table.footer.onClick('first');\n}"
140              },
141              "xtype" : "HttpProxy",
142              "$ xns" : "Roo.data",
143              "String method" : "GET",
144              "* prop" : "proxy",
145              "$ String url" : "baseURL + '/Roo/core_company'"
146             }
147            ]
148           },
149           {
150            "String header" : "Type",
151            "String dataIndex" : "comptype",
152            "Number width" : 90,
153            "xtype" : "ColumnModel",
154            "$ xns" : "Roo.grid",
155            "$ renderer" : "function (v,x ,r) {\n    //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n    return v;\n}",
156            "Boolean sortable" : true,
157            "* prop" : "cm[]"
158           },
159           {
160            "String header" : "Ref#",
161            "String dataIndex" : "code",
162            "Number width" : 50,
163            "xtype" : "ColumnModel",
164            "$ xns" : "Roo.grid",
165            "$ renderer" : "function(v) { return String.format('{0}', v); }",
166            "Boolean sortable" : true,
167            "* prop" : "cm[]"
168           },
169           {
170            "String header" : "Name",
171            "String dataIndex" : "name",
172            "Number width" : 200,
173            "xtype" : "ColumnModel",
174            "$ xns" : "Roo.grid",
175            "$ renderer" : "function(v,x,r) {\n    return String.format(r.data.comptype == 'OWNER' ? '<B>{0}</B>' : '{0}',v);    \n}",
176            "Boolean sortable" : true,
177            "* prop" : "cm[]"
178           },
179           {
180            "String header" : "Tel",
181            "String dataIndex" : "tel",
182            "Number width" : 100,
183            "xtype" : "ColumnModel",
184            "$ xns" : "Roo.grid",
185            "$ renderer" : "function(v) { return String.format('{0}', v); }",
186            "* prop" : "cm[]"
187           },
188           {
189            "String header" : "Fax",
190            "String dataIndex" : "fax",
191            "Number width" : 100,
192            "xtype" : "ColumnModel",
193            "$ xns" : "Roo.grid",
194            "$ renderer" : "function(v) { return String.format('{0}', v); }",
195            "* prop" : "cm[]"
196           },
197           {
198            "String header" : "Email",
199            "String dataIndex" : "email",
200            "Number width" : 200,
201            "xtype" : "ColumnModel",
202            "$ xns" : "Roo.grid",
203            "$ renderer" : "function (v) {\n        console.log('render:' + v);\n        return (v.length && v.indexOf('@') > 0 ) ? \n            String.format('<a href=\"mailto:{0}\">{0}</a>',v) : v;\n            \n    }",
204            "Boolean sortable" : true,
205            "* prop" : "cm[]"
206           },
207           {
208            "String header" : "Address",
209            "String dataIndex" : "address",
210            "Number width" : 250,
211            "xtype" : "ColumnModel",
212            "$ xns" : "Roo.grid",
213            "$ renderer" : "function(v) { return String.format('{0}', v); }",
214            "Boolean sortable" : true,
215            "* prop" : "cm[]"
216           },
217           {
218            "String header" : "Remarks",
219            "String dataIndex" : "remarks",
220            "Number width" : 200,
221            "xtype" : "ColumnModel",
222            "$ xns" : "Roo.grid",
223            "$ renderer" : "function(v) { return String.format('{0}', v); }",
224            "* prop" : "cm[]",
225            "Boolean hidden" : true
226           },
227           {
228            "String header" : "id",
229            "String dataIndex" : "id",
230            "Number width" : 50,
231            "xtype" : "ColumnModel",
232            "$ xns" : "Roo.grid",
233            "$ renderer" : "function(v) { return String.format('{0}', v); }",
234            "Boolean sortable" : true,
235            "* prop" : "cm[]",
236            "Boolean hidden" : true
237           },
238           {
239            "listeners" : {
240             "render" : "function (_self)\n{\n    _this.footer = _self;\n}"
241            },
242            "Number pageSize" : 25,
243            "Boolean displayInfo" : true,
244            "String displayMsg" : "Displaying Companies{0} - {1} of {2}",
245            "xtype" : "PagingToolbar",
246            "String emptyMsg" : "No Companies found",
247            "$ xns" : "Roo.bootstrap",
248            "* prop" : "footer",
249            "string name" : "footer"
250           }
251          ]
252         }
253        ]
254       }
255      ]
256     }
257    ]
258   }
259  ]
260 }