Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtuplePurchasesVendors.bjs
1 {
2     "id": "roo-file-60",
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                                         "rowdblclick": "function (_self, rowIndex, e)\n{\n    var s = _this.grid.ds.getAt(rowIndex);\n    if(s.data.vend_id * 1 < 1){\n        Roo.MessageBox.alert(\"Error\", \"Select a row\");\n    }\n    \n    Pman.Dialog.XtupleVendorEdit.show(s.data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}"
44                                     },
45                                     "*prop": "grid",
46                                     "autoExpandColumn": "vend_name",
47                                     "loadMask": true,
48                                     "xtype": "Grid",
49                                     "|xns": "Roo.grid",
50                                     "items": [
51                                         {
52                                             "*prop": "sm",
53                                             "singleSelect": true,
54                                             "xtype": "RowSelectionModel",
55                                             "|xns": "Roo.grid"
56                                         },
57                                         {
58                                             "listeners": {
59                                                 "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    \n    if (!_this.active.pressed) {\n        options.params.vend_active = 1;\n    } \n}"
60                                             },
61                                             "*prop": "dataSource",
62                                             "remoteSort": true,
63                                             "xtype": "Store",
64                                             "|sortInfo": "{ field : 'vend_name', direction: 'ASC' }",
65                                             "|xns": "Roo.data",
66                                             "items": [
67                                                 {
68                                                     "*prop": "proxy",
69                                                     "method": "GET",
70                                                     "xtype": "HttpProxy",
71                                                     "|url": "baseURL + '/Roo/Vendinfo.php'",
72                                                     "|xns": "Roo.data"
73                                                 },
74                                                 {
75                                                     "*prop": "reader",
76                                                     "id": "vend_id",
77                                                     "root": "data",
78                                                     "totalProperty": "total",
79                                                     "xtype": "JsonReader",
80                                                     "|fields": "[\n    {\n        'name': 'vend_id',\n        'type': 'int'\n    },\n    {\n        'name': 'vend_name',\n        'type': 'string'\n    }\n]",
81                                                     "|xns": "Roo.data"
82                                                 }
83                                             ]
84                                         },
85                                         {
86                                             "*prop": "footer",
87                                             "displayInfo": true,
88                                             "displayMsg": "Displaying vendinfo{0} - {1} of {2}",
89                                             "emptyMsg": "No vendinfo found",
90                                             "pageSize": 25,
91                                             "xtype": "PagingToolbar",
92                                             "|xns": "Roo"
93                                         },
94                                         {
95                                             "*prop": "toolbar",
96                                             "xtype": "Toolbar",
97                                             "|xns": "Roo",
98                                             "items": [
99                                                 {
100                                                     "text": "Search : ",
101                                                     "xtype": "TextItem",
102                                                     "|xns": "Roo.Toolbar"
103                                                 },
104                                                 {
105                                                     "listeners": {
106                                                         "render": "function (_self)\n{\n    _this.searchBox = _self;\n}",
107                                                         "specialkey": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
108                                                     },
109                                                     "xtype": "TextField",
110                                                     "|xns": "Roo.form"
111                                                 },
112                                                 {
113                                                     "listeners": {
114                                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
115                                                     },
116                                                     "cls": "x-btn-icon",
117                                                     "xtype": "Button",
118                                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
119                                                     "|xns": "Roo.Toolbar"
120                                                 },
121                                                 {
122                                                     "listeners": {
123                                                         "|click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\n    \n    \n    _this.grid.footer.onClick('first');\n}"
124                                                     },
125                                                     "cls": "x-btn-icon",
126                                                     "xtype": "Button",
127                                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
128                                                     "|xns": "Roo.Toolbar"
129                                                 },
130                                                 {
131                                                     "|xns": "Roo.Toolbar",
132                                                     "xtype": "Separator"
133                                                 },
134                                                 {
135                                                     "listeners": {
136                                                         "toggle": "function (_self, pressed)\n{\n\n    this.setText(pressed ? \"Hide Inactive\" : \"Show Inactive\");\n    (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
137                                                         "render": "function (_self)\n{\n    _this.active = _self;\n}"
138                                                     },
139                                                     "enableToggle": true,
140                                                     "text": "Show Inactive",
141                                                     "xtype": "Button",
142                                                     "|xns": "Roo.Toolbar"
143                                                 },
144                                                 {
145                                                     "|xns": "Roo.Toolbar",
146                                                     "xtype": "Fill"
147                                                 },
148                                                 {
149                                                     "listeners": {
150                                                         "|click": "function()\n{\n\n   Pman.Dialog.XtupleVendorEdit.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
151                                                     },
152                                                     "cls": "x-btn-text-icon",
153                                                     "text": "Add",
154                                                     "xtype": "Button",
155                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
156                                                     "|xns": "Roo.Toolbar"
157                                                 },
158                                                 {
159                                                     "listeners": {
160                                                         "|click": "function()\n{\n     var s = _this.grid.getSelectionModel().getSelected();\n     \n     if(!s || s.data.vend_id * 1 < 1){\n        Roo.MessageBox.alert('Error', 'Please select a row');\n        return;\n     }\n     \n     Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete that?\",\n        function(v) {\n            if (v != 'yes') {\n                return;\n            }\n             new Pman.Request({\n                method: 'POST',\n                url: baseURL+ '/Roo/vendinfo',\n                params : {\n                    _delete : s.data.vend_id\n                },\n                success : function() {\n                    _this.grid.footer.onClick('refresh');\n                }\n            });\n    });\n}\n        "
161                                                     },
162                                                     "cls": "x-btn-text-icon",
163                                                     "text": "Delete",
164                                                     "xtype": "Button",
165                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
166                                                     "|xns": "Roo.Toolbar"
167                                                 },
168                                                 {
169                                                     "listeners": {
170                                                         "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}"
171                                                     },
172                                                     "text": "Upload Vendors",
173                                                     "xtype": "Button",
174                                                     "|xns": "Roo.Toolbar"
175                                                 }
176                                             ]
177                                         },
178                                         {
179                                             "*prop": "colModel[]",
180                                             "dataIndex": "vend_name",
181                                             "header": "Name",
182                                             "width": 100,
183                                             "xtype": "ColumnModel",
184                                             "|renderer": "function(v) { return String.format('{0}', v); }",
185                                             "|xns": "Roo.grid"
186                                         },
187                                         {
188                                             "*prop": "colModel[]",
189                                             "dataIndex": "vend_vendtype_id_vendtype_descrip",
190                                             "header": "Type",
191                                             "width": 150,
192                                             "xtype": "ColumnModel",
193                                             "|renderer": "function(v) { return String.format('{0}', v); }",
194                                             "|xns": "Roo.grid"
195                                         },
196                                         {
197                                             "*prop": "colModel[]",
198                                             "dataIndex": "vend_char_internalcompany",
199                                             "header": "Internal?",
200                                             "width": 100,
201                                             "xtype": "ColumnModel",
202                                             "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
203                                             "|xns": "Roo.grid"
204                                         }
205                                     ]
206                                 }
207                             ]
208                         }
209                     ]
210                 }
211             ]
212         }
213     ],
214     "permname": "",
215     "modOrder": "300"
216 }