Pman.Tab.MTrackMilestone.bjs
[Pman.MTrack] / Pman.Tab.MTrackMilestone.bjs
1 {
2     "id": "roo-file-237",
3     "name": "Pman.Tab.MTrackMilestone",
4     "parent": "Pman.Tab.MTrack",
5     "title": "Pman.Tab.MTrackMilestone",
6     "path": "/home/alan/gitlive/Pman.MTrack/Pman.Tab.MTrackMilestone.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "mtrack_milestone",
17             "title": "Milestones",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "listeners": {
23                         "|render": "function() \n{\n    _this.grid = this; \n     _this.dialog = Pman.Dialog.MTrackMilestone\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
24                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
25                     },
26                     "*prop": "grid",
27                     "autoExpandColumn": "name",
28                     "loadMask": true,
29                     "xtype": "Grid",
30                     "|xns": "Roo.grid",
31                     "items": [
32                         {
33                             "listeners": {
34                                 "beforeload": "function (_self, options)\n{\n    options.params._with_active_tickets = 1;\n    if (!_this.viewType) {\n        return false;\n    }\n    options.params._viewtype = _this.viewType.getValue();\n    \n    if (_this.projsel.getValue()) {\n         options.params.project_id = _this.projsel.getValue();\n    }\n    \n    \n}"
35                             },
36                             "*prop": "dataSource",
37                             "remoteSort": true,
38                             "xtype": "Store",
39                             "|sortInfo": "{ field : 'duedate', direction: 'ASC' }",
40                             "|xns": "Roo.data",
41                             "items": [
42                                 {
43                                     "*prop": "proxy",
44                                     "xtype": "HttpProxy",
45                                     "method": "GET",
46                                     "|url": "baseURL + '/Roo/mtrack_milestone.php'",
47                                     "|xns": "Roo.data"
48                                 },
49                                 {
50                                     "|xns": "Roo.data",
51                                     "xtype": "JsonReader",
52                                     "totalProperty": "total",
53                                     "root": "data",
54                                     "*prop": "reader",
55                                     "id": "id",
56                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'description',\n        'type': 'string'\n    },\n    {\n        'name': 'startdate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'duedate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'completed',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'deleted',\n        'type': 'int'\n    },\n    {\n        'name': 'created',\n        'type': 'int'\n    },\n    {\n        'name': 'updated',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'deleted_id',\n        'type': 'int'\n    },\n    {\n        'name': 'deleted_person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'deleted_ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'deleted_onid',\n        'type': 'int'\n    },\n    {\n        'name': 'deleted_changedate',\n        'type': 'date'\n    },\n    {\n        'name': 'deleted_reason',\n        'type': 'string'\n    },\n    {\n        'name': 'updated_id',\n        'type': 'int'\n    },\n    {\n        'name': 'updated_person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'updated_ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'updated_onid',\n        'type': 'int'\n    },\n    {\n        'name': 'updated_changedate',\n        'type': 'date'\n    },\n    {\n        'name': 'updated_reason',\n        'type': 'string'\n    },\n    {\n        'name': 'created_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created_person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created_ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'created_onid',\n        'type': 'int'\n    },\n    {\n        'name': 'created_changedate',\n        'type': 'date'\n    },\n    {\n        'name': 'created_reason',\n        'type': 'string'\n    }\n]"
57                                 }
58                             ]
59                         },
60                         {
61                             "*prop": "footer",
62                             "xtype": "PagingToolbar",
63                             "pageSize": 25,
64                             "displayInfo": true,
65                             "displayMsg": "Displaying mtrack_milestone{0} - {1} of {2}",
66                             "emptyMsg": "No mtrack_milestone found",
67                             "|xns": "Roo"
68                         },
69                         {
70                             "*prop": "toolbar",
71                             "xtype": "Toolbar",
72                             "|xns": "Roo",
73                             "items": [
74                                 {
75                                     "text": "View:",
76                                     "xtype": "TextItem",
77                                     "|xns": "Roo.Toolbar"
78                                 },
79                                 {
80                                     "listeners": {
81                                         "render": "function (_self)\n{\n   _this.viewType = this;\n}",
82                                         "beforeselect": "function (combo, record, index)\n{\n  (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}"
83                                     },
84                                     "allowBlank": false,
85                                     "displayField": "val",
86                                     "editable": false,
87                                     "forceSelection": true,
88                                     "hiddenName": "currency",
89                                     "listWidth": 200,
90                                     "triggerAction": "all",
91                                     "value": "HEAD",
92                                     "valueField": "key",
93                                     "width": 150,
94                                     "xtype": "ComboBox",
95                                     "|xns": "Roo.form",
96                                     "items": [
97                                         {
98                                             "*prop": "store",
99                                             "|fields": "[ 'key' , 'val' ]",
100                                             "xtype": "SimpleStore",
101                                             "|data": "[ \n  [ 'HEAD', 'Head Milestones' ],\n  [ 'ACTIVE', 'Active Milestones' ],\n  [ 'ALL', 'All Milestones' ]\n  ]",
102                                             "|xns": "Roo.data"
103                                         }
104                                     ]
105                                 },
106                                 {
107                                     "listeners": {
108                                         "render": "function (_self)\n{\n   _this.projsel = _self;\n}",
109                                         "beforeselect": "function (combo, record, index)\n{\n  (function() { _this.grid.onClick('first')}).defer(100);\n}"
110                                     },
111                                     "allowBlank": "false",
112                                     "displayField": "name",
113                                     "editable": false,
114                                     "emptyText": "Select Projects",
115                                     "fieldLabel": "Projects",
116                                     "forceSelection": true,
117                                     "hiddenName": "project_id",
118                                     "listWidth": 400,
119                                     "loadingText": "Searching...",
120                                     "minChars": 2,
121                                     "name": "project_id_name",
122                                     "pageSize": 50,
123                                     "qtip": "Select Projects",
124                                     "queryParam": "",
125                                     "selectOnFocus": true,
126                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{code}</b> {name}</div>",
127                                     "triggerAction": "all",
128                                     "typeAhead": true,
129                                     "valueField": "id",
130                                     "width": 200,
131                                     "xtype": "ComboBox",
132                                     "|xns": "Roo.form",
133                                     "items": [
134                                         {
135                                             "listeners": {
136                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
137                                             },
138                                             "*prop": "store",
139                                             "remoteSort": true,
140                                             "xtype": "Store",
141                                             "|sortInfo": "{ direction : 'ASC', field: 'code' }",
142                                             "|xns": "Roo.data",
143                                             "items": [
144                                                 {
145                                                     "*prop": "proxy",
146                                                     "xtype": "HttpProxy",
147                                                     "method": "GET",
148                                                     "|xns": "Roo.data",
149                                                     "|url": "baseURL + '/Roo/Projects.php'"
150                                                 },
151                                                 {
152                                                     "*prop": "reader",
153                                                     "xtype": "JsonReader",
154                                                     "|xns": "Roo.data",
155                                                     "id": "id",
156                                                     "root": "data",
157                                                     "totalProperty": "total",
158                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
159                                                 }
160                                             ]
161                                         }
162                                     ]
163                                 },
164                                 {
165                                     "|xns": "Roo.Toolbar",
166                                     "xtype": "Fill"
167                                 },
168                                 {
169                                     "text": "Add",
170                                     "xtype": "Button",
171                                     "cls": "x-btn-text-icon",
172                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
173                                     "listeners": {
174                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
175                                     },
176                                     "|xns": "Roo.Toolbar"
177                                 },
178                                 {
179                                     "text": "Edit",
180                                     "xtype": "Button",
181                                     "cls": "x-btn-text-icon",
182                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
183                                     "listeners": {
184                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
185                                     },
186                                     "|xns": "Roo.Toolbar"
187                                 },
188                                 {
189                                     "listeners": {
190                                         "|click": "function()\n        {\n        Pman.genericDelete(_this, 'mtrack_milestone'); \n        }\n        "
191                                     },
192                                     "cls": "x-btn-text-icon",
193                                     "text": "Delete",
194                                     "xtype": "Button",
195                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
196                                     "|xns": "Roo.Toolbar"
197                                 }
198                             ]
199                         },
200                         {
201                             "*prop": "colModel[]",
202                             "dataIndex": "project_id_name",
203                             "header": "Project",
204                             "sortable": true,
205                             "width": 150,
206                             "xtype": "ColumnModel",
207                             "|renderer": "function(v) { return String.format('{0}', v); }",
208                             "|xns": "Roo.grid"
209                         },
210                         {
211                             "*prop": "colModel[]",
212                             "dataIndex": "active_tickets",
213                             "header": "#Tickets",
214                             "width": 50,
215                             "xtype": "ColumnModel",
216                             "|renderer": "function(v) { return String.format('{0}', v); }",
217                             "|xns": "Roo.grid"
218                         },
219                         {
220                             "xtype": "ColumnModel",
221                             "header": "Name",
222                             "width": 200,
223                             "dataIndex": "name",
224                             "|renderer": "function(v) { return String.format('{0}', v); }",
225                             "|xns": "Roo.grid",
226                             "*prop": "colModel[]"
227                         },
228                         {
229                             "xtype": "ColumnModel",
230                             "header": "Description",
231                             "width": 200,
232                             "dataIndex": "description",
233                             "|renderer": "function(v) { return String.format('{0}', v); }",
234                             "|xns": "Roo.grid",
235                             "*prop": "colModel[]"
236                         },
237                         {
238                             "*prop": "colModel[]",
239                             "dataIndex": "startdate",
240                             "header": "Startdate",
241                             "sortable": true,
242                             "width": 75,
243                             "xtype": "ColumnModel",
244                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
245                             "|xns": "Roo.grid"
246                         },
247                         {
248                             "xtype": "ColumnModel",
249                             "header": "Duedate",
250                             "width": 75,
251                             "dataIndex": "duedate",
252                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
253                             "|xns": "Roo.grid",
254                             "*prop": "colModel[]"
255                         },
256                         {
257                             "*prop": "colModel[]",
258                             "dataIndex": "on_hold",
259                             "header": "On-hold",
260                             "width": 75,
261                             "xtype": "ColumnModel",
262                             "|renderer": "function(v) { return String.format('{0}', v ); }",
263                             "|xns": "Roo.grid"
264                         },
265                         {
266                             "xtype": "ColumnModel",
267                             "header": "Completed",
268                             "width": 75,
269                             "dataIndex": "completed",
270                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
271                             "|xns": "Roo.grid",
272                             "*prop": "colModel[]"
273                         }
274                     ]
275                 }
276             ]
277         }
278     ],
279     "permname": "",
280     "modOrder": "200"
281 }