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