Pman.Tab.XtuplePurchasesVendors.bjs
[Pman.Xtuple] / Pman.Tab.XtuplePurchasesVendors.bjs
1 {
2     "id": "roo-file-53",
3     "name": "Pman.Tab.XtuplePurchasesVendors",
4     "parent": "Pman.Tab.XtuplePurchases",
5     "title": "",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtuplePurchasesVendors.bjs",
7     "items": [
8         {
9             "background": true,
10             "fitContainer": true,
11             "fitToFrame": true,
12             "region": "center",
13             "title": "Vendors",
14             "xtype": "NestedLayoutPanel",
15             "|xns": "Roo",
16             "items": [
17                 {
18                     "|xns": "Roo",
19                     "xtype": "BorderLayout",
20                     "*prop": "layout",
21                     "items": [
22                         {
23                             "|xns": "Roo",
24                             "xtype": "LayoutRegion",
25                             "*prop": "center"
26                         },
27                         {
28                             "listeners": {
29                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
30                             },
31                             "background": false,
32                             "fitContainer": true,
33                             "fitToframe": true,
34                             "region": "center",
35                             "tableName": "vendinfo",
36                             "title": "Vendors",
37                             "xtype": "GridPanel",
38                             "|xns": "Roo",
39                             "items": [
40                                 {
41                                     "listeners": {
42                                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}"
43                                     },
44                                     "*prop": "grid",
45                                     "autoExpandColumn": "vend_name",
46                                     "loadMask": true,
47                                     "xtype": "Grid",
48                                     "|xns": "Roo.grid",
49                                     "items": [
50                                         {
51                                             "*prop": "sm",
52                                             "singleSelect": true,
53                                             "xtype": "RowSelectionModel",
54                                             "|xns": "Roo.grid"
55                                         },
56                                         {
57                                             "listeners": {
58                                                 "beforeload": "function (_self, options)\n{\n    \n    if (! _this.searchBox) {\n    // not rendered yet...\n        return false;\n            \n    }\n    options.params = options.params || {};\n    options.params._with_char = 1;\n    options.params['search[name]'] = _this.searchBox.getValue();\n}"
59                                             },
60                                             "*prop": "dataSource",
61                                             "remoteSort": true,
62                                             "xtype": "Store",
63                                             "|sortInfo": "{ field : 'vend_name', direction: 'ASC' }",
64                                             "|xns": "Roo.data",
65                                             "items": [
66                                                 {
67                                                     "*prop": "proxy",
68                                                     "method": "GET",
69                                                     "xtype": "HttpProxy",
70                                                     "|url": "baseURL + '/Roo/Vendinfo.php'",
71                                                     "|xns": "Roo.data"
72                                                 },
73                                                 {
74                                                     "*prop": "reader",
75                                                     "id": "vend_id",
76                                                     "root": "data",
77                                                     "totalProperty": "total",
78                                                     "xtype": "JsonReader",
79                                                     "|fields": "[\n    {\n        'name': 'vend_id',\n        'type': 'int'\n    },\n    {\n        'name': 'vend_name',\n        'type': 'string'\n    }\n]",
80                                                     "|xns": "Roo.data"
81                                                 }
82                                             ]
83                                         },
84                                         {
85                                             "*prop": "footer",
86                                             "displayInfo": true,
87                                             "displayMsg": "Displaying vendinfo{0} - {1} of {2}",
88                                             "emptyMsg": "No vendinfo found",
89                                             "pageSize": 25,
90                                             "xtype": "PagingToolbar",
91                                             "|xns": "Roo"
92                                         },
93                                         {
94                                             "*prop": "toolbar",
95                                             "xtype": "Toolbar",
96                                             "|xns": "Roo",
97                                             "items": [
98                                                 {
99                                                     "text": "Search : ",
100                                                     "xtype": "TextItem",
101                                                     "|xns": "Roo.Toolbar"
102                                                 },
103                                                 {
104                                                     "listeners": {
105                                                         "render": "function (_self)\n{\n    _this.searchBox = _self;\n}",
106                                                         "specialkey": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
107                                                     },
108                                                     "xtype": "TextField",
109                                                     "|xns": "Roo.form"
110                                                 },
111                                                 {
112                                                     "listeners": {
113                                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
114                                                     },
115                                                     "cls": "x-btn-icon",
116                                                     "xtype": "Button",
117                                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
118                                                     "|xns": "Roo.Toolbar"
119                                                 },
120                                                 {
121                                                     "listeners": {
122                                                         "|click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\n    \n    \n    _this.grid.footer.onClick('first');\n}"
123                                                     },
124                                                     "cls": "x-btn-icon",
125                                                     "xtype": "Button",
126                                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
127                                                     "|xns": "Roo.Toolbar"
128                                                 },
129                                                 {
130                                                     "|xns": "Roo.Toolbar",
131                                                     "xtype": "Separator"
132                                                 },
133                                                 {
134                                                     "listeners": {
135                                                         "|click": "function()\n{\n\n   Pman.Dialog.XtupleVendorEdit.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
136                                                     },
137                                                     "cls": "x-btn-text-icon",
138                                                     "text": "Add",
139                                                     "xtype": "Button",
140                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
141                                                     "|xns": "Roo.Toolbar"
142                                                 },
143                                                 {
144                                                     "listeners": {
145                                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelected();\n    if (!s)  {\n        Roo.MessageBox.alert(\"Error\", \"Select a Row\");\n        return;\n    }\n\n    Pman.Dialog.XtupleVendorEdit.show(s.data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
146                                                     },
147                                                     "cls": "x-btn-text-icon",
148                                                     "text": "Edit",
149                                                     "xtype": "Button",
150                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
151                                                     "|xns": "Roo.Toolbar"
152                                                 },
153                                                 {
154                                                     "|xns": "Roo.Toolbar",
155                                                     "xtype": "Fill"
156                                                 },
157                                                 {
158                                                     "listeners": {
159                                                         "click": "function (_self, e)\n{\n   Pman.Dialog.Image.show(\n       {\n            _url : baseURL+'/Xtuple/Import/Vendors' \n        \n       },\n       function (data) {\n            _this.grid.footer.onClick('first');\n            Roo.MessageBox.alert(\"Notice\", \"DONE\");\n//            Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n       }\n   );\n}"
160                                                     },
161                                                     "text": "Upload Vendors",
162                                                     "xtype": "Button",
163                                                     "|xns": "Roo.Toolbar"
164                                                 }
165                                             ]
166                                         },
167                                         {
168                                             "*prop": "colModel[]",
169                                             "dataIndex": "vend_name",
170                                             "header": "Name",
171                                             "width": 100,
172                                             "xtype": "ColumnModel",
173                                             "|renderer": "function(v) { return String.format('{0}', v); }",
174                                             "|xns": "Roo.grid"
175                                         },
176                                         {
177                                             "*prop": "colModel[]",
178                                             "dataIndex": "vend_char_internalcompany",
179                                             "header": "Internal?",
180                                             "width": 100,
181                                             "xtype": "ColumnModel",
182                                             "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
183                                             "|xns": "Roo.grid"
184                                         }
185                                     ]
186                                 }
187                             ]
188                         }
189                     ]
190                 }
191             ]
192         }
193     ],
194     "permname": "",
195     "modOrder": "300"
196 }