Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtuplePriceList.bjs
1 {
2     "name" : "Pman.Dialog.XtuplePriceList",
3     "parent" : "",
4     "title" : "",
5     "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtuplePriceList.bjs",
6     "permname" : "",
7     "modOrder" : "001",
8     "items" : [
9         {
10             "modal" : true,
11             "collapsible" : false,
12             "title" : "Edit / Create Price List",
13             "xtype" : "LayoutDialog",
14             "width" : 400,
15             "$ xns" : "Roo",
16             "closable" : false,
17             "resizable" : false,
18             "height" : 300,
19             "items" : [
20                 {
21                     "xtype" : "LayoutRegion",
22                     "$ xns" : "Roo",
23                     "* prop" : "center"
24                 },
25                 {
26                     "region" : "center",
27                     "xtype" : "ContentPanel",
28                     "$ xns" : "Roo",
29                     "items" : [
30                         {
31                             "listeners" : {
32                                 "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n\n       \n       if (_this.data.ipshead_id) { \n           this.load({ method: 'GET', params: { '_id' : _this.data.ipshead_id }});\n           return;\n       }\n       this.setValues({\n            ipshead_effective : new Date(1970,1,1),\n            ipshead_expires :new Date(2100,1,1)\n\n       });\n       \n       \n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
33                                 "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
34                             },
35                             "$ url" : "baseURL + '/Roo/ipshead.php'",
36                             "method" : "POST",
37                             "xtype" : "Form",
38                             "style" : "margin:10px;",
39                             "$ xns" : "Roo.form",
40                             "items" : [
41                                 {
42                                     "fieldLabel" : "Name",
43                                     "xtype" : "TextField",
44                                     "allowBlank" : false,
45                                     "width" : 250,
46                                     "$ xns" : "Roo.form",
47                                     "name" : "ipshead_name"
48                                 },
49                                 {
50                                     "fieldLabel" : "Description",
51                                     "xtype" : "TextArea",
52                                     "width" : 250,
53                                     "$ xns" : "Roo.form",
54                                     "name" : "ipshead_descrip",
55                                     "height" : 80
56                                 },
57                                 {
58                                     "listWidth" : 250,
59                                     "triggerAction" : "all",
60                                     "fieldLabel" : "Currency",
61                                     "forceSelection" : true,
62                                     "selectOnFocus" : true,
63                                     "pageSize" : 20,
64                                     "displayField" : "curr_name",
65                                     "emptyText" : "Select currency",
66                                     "hiddenName" : "ipshead_curr_id",
67                                     "minChars" : 2,
68                                     "valueField" : "curr_id",
69                                     "xtype" : "ComboBox",
70                                     "allowBlank" : false,
71                                     "typeAhead" : true,
72                                     "editable" : false,
73                                     "width" : 250,
74                                     "$ xns" : "Roo.form",
75                                     "name" : "ipshead_curr_id_curr_name",
76                                     "qtip" : "Select curr_symbol",
77                                     "queryParam" : "query[curr_name]",
78                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
79                                     "loadingText" : "Searching...",
80                                     "items" : [
81                                         {
82                                             "listeners" : {
83                                                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
84                                             },
85                                             "xtype" : "Store",
86                                             "remoteSort" : true,
87                                             "$ xns" : "Roo.data",
88                                             "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
89                                             "* prop" : "store",
90                                             "items" : [
91                                                 {
92                                                     "$ url" : "baseURL + '/Roo/curr_symbol.php'",
93                                                     "xtype" : "HttpProxy",
94                                                     "method" : "GET",
95                                                     "$ xns" : "Roo.data",
96                                                     "* prop" : "proxy"
97                                                 },
98                                                 {
99                                                     "id" : "id",
100                                                     "root" : "data",
101                                                     "xtype" : "JsonReader",
102                                                     "$ xns" : "Roo.data",
103                                                     "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"curr_name\",\"type\":\"string\"}]",
104                                                     "* prop" : "reader",
105                                                     "totalProperty" : "total"
106                                                 }
107                                             ]
108                                         }
109                                     ]
110                                 },
111                                 {
112                                     "fieldLabel" : "Effective",
113                                     "format" : "d/M/Y",
114                                     "xtype" : "DateField",
115                                     "useIso" : true,
116                                     "allowBlank" : false,
117                                     "width" : 250,
118                                     "$ xns" : "Roo.form",
119                                     "altFormats" : "Y-m-d",
120                                     "name" : "ipshead_effective"
121                                 },
122                                 {
123                                     "fieldLabel" : "Expires",
124                                     "format" : "d/M/Y",
125                                     "xtype" : "DateField",
126                                     "useIso" : true,
127                                     "allowBlank" : false,
128                                     "width" : 250,
129                                     "$ xns" : "Roo.form",
130                                     "altFormats" : "Y-m-d",
131                                     "name" : "ipshead_expires"
132                                 },
133                                 {
134                                     "String name" : "ipshead_id",
135                                     "xtype" : "Hidden",
136                                     "$ xns" : "Roo.form"
137                                 }
138                             ]
139                         }
140                     ]
141                 },
142                 {
143                     "listeners" : {
144                         "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
145                     },
146                     "text" : "Cancel",
147                     "xtype" : "Button",
148                     "$ xns" : "Roo",
149                     "* prop" : "buttons[]"
150                 },
151                 {
152                     "listeners" : {
153                         "click" : "function (_self, e)\n{\n    // do some checks?\n     \n    \n    //_this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
154                     },
155                     "text" : "Save",
156                     "xtype" : "Button",
157                     "$ xns" : "Roo",
158                     "* prop" : "buttons[]"
159                 }
160             ]
161         }
162     ]
163 }