Pman.Tab.MTrackMilestone.bjs
[Pman.MTrack] / Pman.Tab.MTrackMilestone.bjs
1 {
2     "id": "roo-file-119",
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}"
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                                     "|xns": "Roo.Toolbar",
108                                     "xtype": "Fill"
109                                 },
110                                 {
111                                     "text": "Add",
112                                     "xtype": "Button",
113                                     "cls": "x-btn-text-icon",
114                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
115                                     "listeners": {
116                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
117                                     },
118                                     "|xns": "Roo.Toolbar"
119                                 },
120                                 {
121                                     "text": "Edit",
122                                     "xtype": "Button",
123                                     "cls": "x-btn-text-icon",
124                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
125                                     "listeners": {
126                                         "|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"
127                                     },
128                                     "|xns": "Roo.Toolbar"
129                                 },
130                                 {
131                                     "listeners": {
132                                         "|click": "function()\n        {\n        Pman.genericDelete(_this, 'mtrack_milestone'); \n        }\n        "
133                                     },
134                                     "cls": "x-btn-text-icon",
135                                     "text": "Delete",
136                                     "xtype": "Button",
137                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
138                                     "|xns": "Roo.Toolbar"
139                                 }
140                             ]
141                         },
142                         {
143                             "*prop": "colModel[]",
144                             "dataIndex": "project_id_name",
145                             "header": "Project",
146                             "sortable": true,
147                             "width": 150,
148                             "xtype": "ColumnModel",
149                             "|renderer": "function(v) { return String.format('{0}', v); }",
150                             "|xns": "Roo.grid"
151                         },
152                         {
153                             "*prop": "colModel[]",
154                             "dataIndex": "active_tickets",
155                             "header": "#Tickets",
156                             "width": 50,
157                             "xtype": "ColumnModel",
158                             "|renderer": "function(v) { return String.format('{0}', v); }",
159                             "|xns": "Roo.grid"
160                         },
161                         {
162                             "xtype": "ColumnModel",
163                             "header": "Name",
164                             "width": 200,
165                             "dataIndex": "name",
166                             "|renderer": "function(v) { return String.format('{0}', v); }",
167                             "|xns": "Roo.grid",
168                             "*prop": "colModel[]"
169                         },
170                         {
171                             "xtype": "ColumnModel",
172                             "header": "Description",
173                             "width": 200,
174                             "dataIndex": "description",
175                             "|renderer": "function(v) { return String.format('{0}', v); }",
176                             "|xns": "Roo.grid",
177                             "*prop": "colModel[]"
178                         },
179                         {
180                             "*prop": "colModel[]",
181                             "dataIndex": "startdate",
182                             "header": "Startdate",
183                             "sortable": true,
184                             "width": 75,
185                             "xtype": "ColumnModel",
186                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
187                             "|xns": "Roo.grid"
188                         },
189                         {
190                             "xtype": "ColumnModel",
191                             "header": "Duedate",
192                             "width": 75,
193                             "dataIndex": "duedate",
194                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
195                             "|xns": "Roo.grid",
196                             "*prop": "colModel[]"
197                         },
198                         {
199                             "xtype": "ColumnModel",
200                             "header": "Completed",
201                             "width": 75,
202                             "dataIndex": "completed",
203                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
204                             "|xns": "Roo.grid",
205                             "*prop": "colModel[]"
206                         }
207                     ]
208                 }
209             ]
210         }
211     ],
212     "permname": "",
213     "modOrder": "200"
214 }