Pman.Dialog.MTrackMilestone.bjs
[Pman.MTrack] / Pman.Dialog.MTrackMilestone.bjs
1 {
2     "id": "roo-file-116",
3     "name": "Pman.Dialog.MTrackMilestone",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/Pman.MTrack/Pman.Dialog.MTrackMilestone.bjs",
7     "items": [
8         {
9             "closable": false,
10             "collapsible": false,
11             "height": 320,
12             "resizable": false,
13             "title": "Edit / Create mtrack_milestone",
14             "width": 450,
15             "xtype": "LayoutDialog",
16             "|xns": "Roo",
17             "items": [
18                 {
19                     "|xns": "Roo",
20                     "xtype": "LayoutRegion",
21                     "*prop": "center"
22                 },
23                 {
24                     "region": "center",
25                     "xtype": "ContentPanel",
26                     "|xns": "Roo",
27                     "items": [
28                         {
29                             "listeners": {
30                                 "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       if (_this.data.id) {\n\n         this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n         return;\n       }\n       return;\n    }\n    if (action.type == 'load') {\n        \n        return;\n    }\n    if (action.type =='submit') {\n    \n        \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",
31                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
32                             },
33                             "method": "POST",
34                             "style": "margin:10px;",
35                             "xtype": "Form",
36                             "|url": "baseURL + '/Roo/mtrack_milestone.php'",
37                             "|xns": "Roo.form",
38                             "items": [
39                                 {
40                                     "allowBlank": "false",
41                                     "displayField": "name",
42                                     "editable": "false",
43                                     "emptyText": "Select Project",
44                                     "fieldLabel": "Project",
45                                     "forceSelection": true,
46                                     "hiddenName": "project_id",
47                                     "listWidth": 400,
48                                     "loadingText": "Searching...",
49                                     "minChars": 2,
50                                     "name": "project_id_name",
51                                     "pageSize": 20,
52                                     "qtip": "Select Projects",
53                                     "queryParam": "query[name]",
54                                     "selectOnFocus": true,
55                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{CODE} - {name}</b> </div>",
56                                     "triggerAction": "all",
57                                     "typeAhead": true,
58                                     "valueField": "id",
59                                     "width": 300,
60                                     "xtype": "ComboBox",
61                                     "|xns": "Roo.form",
62                                     "items": [
63                                         {
64                                             "listeners": {
65                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
66                                             },
67                                             "*prop": "store",
68                                             "remoteSort": true,
69                                             "xtype": "Store",
70                                             "|sortInfo": "{ direction : 'ASC', field: 'name' }",
71                                             "|xns": "Roo.data",
72                                             "items": [
73                                                 {
74                                                     "*prop": "proxy",
75                                                     "xtype": "HttpProxy",
76                                                     "method": "GET",
77                                                     "|xns": "Roo.data",
78                                                     "|url": "baseURL + '/Roo/Projects.php'"
79                                                 },
80                                                 {
81                                                     "*prop": "reader",
82                                                     "xtype": "JsonReader",
83                                                     "|xns": "Roo.data",
84                                                     "id": "id",
85                                                     "root": "data",
86                                                     "totalProperty": "total",
87                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
88                                                 }
89                                             ]
90                                         }
91                                     ]
92                                 },
93                                 {
94                                     "fieldLabel": "Name",
95                                     "name": "name",
96                                     "width": 300,
97                                     "xtype": "TextField",
98                                     "|xns": "Roo.form"
99                                 },
100                                 {
101                                     "fieldLabel": "Description",
102                                     "height": 100,
103                                     "name": "description",
104                                     "width": 300,
105                                     "xtype": "TextArea",
106                                     "|xns": "Roo.form"
107                                 },
108                                 {
109                                     "allowBlank": "false",
110                                     "boxWidth": 300,
111                                     "displayField": "name",
112                                     "editable": true,
113                                     "emptyText": "Select Milestones",
114                                     "fieldLabel": "Depends On",
115                                     "forceSelection": true,
116                                     "hiddenName": "depends_on",
117                                     "listWidth": 400,
118                                     "loadingText": "Searching...",
119                                     "minChars": 2,
120                                     "name": "depends_on_list",
121                                     "pageSize": 20,
122                                     "qtip": "Select Milestones",
123                                     "queryParam": "query[name]",
124                                     "selectOnFocus": true,
125                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
126                                     "triggerAction": "all",
127                                     "typeAhead": true,
128                                     "valueField": "id",
129                                     "width": 150,
130                                     "xtype": "ComboBoxLister",
131                                     "|xns": "Roo.form",
132                                     "items": [
133                                         {
134                                             "listeners": {
135                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
136                                             },
137                                             "*prop": "store",
138                                             "remoteSort": true,
139                                             "xtype": "Store",
140                                             "|sortInfo": "{ direction : 'ASC', field: 'name' }",
141                                             "|xns": "Roo.data",
142                                             "items": [
143                                                 {
144                                                     "*prop": "proxy",
145                                                     "method": "GET",
146                                                     "xtype": "HttpProxy",
147                                                     "|url": "baseURL + '/Roo/Mtrack_milestone.php'",
148                                                     "|xns": "Roo.data"
149                                                 },
150                                                 {
151                                                     "*prop": "reader",
152                                                     "xtype": "JsonReader",
153                                                     "|xns": "Roo.data",
154                                                     "id": "id",
155                                                     "root": "data",
156                                                     "totalProperty": "total",
157                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
158                                                 }
159                                             ]
160                                         }
161                                     ]
162                                 },
163                                 {
164                                     "fieldLabel": "Startdate",
165                                     "format": "Y-m-d",
166                                     "name": "startdate",
167                                     "width": 75,
168                                     "xtype": "DateField",
169                                     "|value": "(function() { (new Date()).format('Y-m-d')})()",
170                                     "|xns": "Roo.form"
171                                 },
172                                 {
173                                     "|xns": "Roo.form",
174                                     "xtype": "Row",
175                                     "items": [
176                                         {
177                                             "fieldLabel": "Startdate",
178                                             "format": "Y-m-d",
179                                             "name": "startdate",
180                                             "width": 75,
181                                             "xtype": "DateField",
182                                             "|value": "(function() { (new Date()).format('Y-m-d')})()",
183                                             "|xns": "Roo.form"
184                                         }
185                                     ]
186                                 },
187                                 {
188                                     "fieldLabel": "Duedate",
189                                     "format": "Y-m-d",
190                                     "name": "duedate",
191                                     "width": 75,
192                                     "xtype": "DateField",
193                                     "|xns": "Roo.form"
194                                 },
195                                 {
196                                     "fieldLabel": "Completed",
197                                     "format": "Y-m-d",
198                                     "name": "completed",
199                                     "width": 75,
200                                     "xtype": "DateField",
201                                     "|xns": "Roo.form"
202                                 },
203                                 {
204                                     "name": "id",
205                                     "|xns": "Roo.form",
206                                     "xtype": "Hidden"
207                                 }
208                             ]
209                         }
210                     ]
211                 },
212                 {
213                     "listeners": {
214                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
215                     },
216                     "*prop": "buttons[]",
217                     "text": "Cancel",
218                     "xtype": "Button",
219                     "|xns": "Roo"
220                 },
221                 {
222                     "listeners": {
223                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
224                     },
225                     "*prop": "buttons[]",
226                     "text": "Save",
227                     "xtype": "Button",
228                     "|xns": "Roo"
229                 }
230             ]
231         }
232     ],
233     "permname": "",
234     "modOrder": "001"
235 }