DataObjects/Core_watch.php
[Pman.Core] / Pman.Dialog.CoreNotifyRecur.bjs
index 0dd493f..89475d0 100644 (file)
@@ -1,15 +1,15 @@
 {
-    "id": "roo-file-94",
+    "id": "roo-file-183",
     "name": "Pman.Dialog.CoreNotifyRecur",
     "parent": "",
     "title": "",
-    "path": "/home/alan/gitlive/Pman.Core/Pman.Dialog.CoreNotifyRecur.bjs",
+    "path": "/home/edward/gitlive/Pman.Core/Pman.Dialog.CoreNotifyRecur.bjs",
     "items": [
         {
             "listeners": {
                 "show": "function (_self)\n{\n    _this.grid.ds.load({});\n}"
             },
-            "height": 500,
+            "height": 550,
             "modal": true,
             "resizable": false,
             "title": "Modify Recurrent Notifications",
@@ -86,7 +86,7 @@
                                     "items": [
                                         {
                                             "listeners": {
-                                                "|click": "function()\n{\n    var grid = _this.grid;\n    var r = grid.getDataSource().reader.newRow({\n    // defaults..\n        person_id : _this.data.person_id,\n        dtstart : new Date(),\n        dtend : Date.parseDate('2050-01-01', 'Y-m-d'),\n        tz : 'Asia/Hong_Kong',\n        onid : _this.data.onid,\n        ontable : _this.data.ontable,\n        method : _this.data.method,\n        last_event_id : 0,\n        freq_day_name : '',\n        freq_hour_name : '',\n        freq_name : ''\n        \n    \n    });\n    grid.stopEditing();\n    grid.getDataSource().insert(0, r); \n    grid.startEditing(0, 2); \n    \n\n}\n"
+                                                "|click": "function()\n{\n    var grid = _this.grid;\n    var r = grid.getDataSource().reader.newRow({\n    // defaults..\n        person_id : _this.data.person_id,\n        dtstart : new Date(),\n        dtend : Date.parseDate('2050-01-01', 'Y-m-d'),\n        tz : 'Asia/Hong_Kong',\n        onid : _this.data.onid,\n        ontable : _this.data.ontable,\n        method : _this.data.method, // default...\n        \n        method_id : _this.data.method_id, // default...\n        method_id_display_name : _this.data.method_id_display_name, // default...        \n        \n        last_event_id : 0,\n        freq_day_name : '',\n        freq_hour_name : '',\n        freq_name : ''\n        \n    \n    });\n    grid.stopEditing();\n    grid.getDataSource().insert(0, r); \n    grid.startEditing(0, 2); \n    \n\n}\n"
                                             },
                                             "cls": "x-btn-text-icon",
                                             "text": "Add",
                                         }
                                     ]
                                 },
+                                {
+                                    "*prop": "colModel[]",
+                                    "dataIndex": "method_id",
+                                    "header": "Type",
+                                    "width": 120,
+                                    "xtype": "ColumnModel",
+                                    "|renderer": "function(v,x,r) {\n     return String.format('{0}', r.data.method_id_display_name); \n}",
+                                    "|xns": "Roo.grid",
+                                    "items": [
+                                        {
+                                            "|xns": "Roo.grid",
+                                            "xtype": "GridEditor",
+                                            "*prop": "editor",
+                                            "items": [
+                                                {
+                                                    "*prop": "field",
+                                                    "allowBlank": "false",
+                                                    "displayField": "display_name",
+                                                    "editable": false,
+                                                    "emptyText": "Select Type",
+                                                    "fieldLabel": "core_enum",
+                                                    "forceSelection": true,
+                                                    "hiddenName": "method_id",
+                                                    "listWidth": 400,
+                                                    "loadingText": "Searching...",
+                                                    "name": "method_id_display_name",
+                                                    "pageSize": 20,
+                                                    "qtip": "Select core_enum",
+                                                    "selectOnFocus": true,
+                                                    "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>",
+                                                    "triggerAction": "all",
+                                                    "typeAhead": true,
+                                                    "valueField": "id",
+                                                    "width": 300,
+                                                    "xtype": "ComboBox",
+                                                    "|xns": "Roo.form",
+                                                    "items": [
+                                                        {
+                                                            "listeners": {
+                                                                "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params.etype = 'core_notify_recur';\n}\n"
+                                                            },
+                                                            "*prop": "store",
+                                                            "remoteSort": true,
+                                                            "xtype": "Store",
+                                                            "|sortInfo": "{ direction : 'ASC', field: 'id' }",
+                                                            "|xns": "Roo.data",
+                                                            "items": [
+                                                                {
+                                                                    "*prop": "proxy",
+                                                                    "xtype": "HttpProxy",
+                                                                    "method": "GET",
+                                                                    "|xns": "Roo.data",
+                                                                    "|url": "baseURL + '/Roo/core_enum.php'"
+                                                                },
+                                                                {
+                                                                    "*prop": "reader",
+                                                                    "xtype": "JsonReader",
+                                                                    "|xns": "Roo.data",
+                                                                    "id": "id",
+                                                                    "root": "data",
+                                                                    "totalProperty": "total",
+                                                                    "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"etype\",\"type\":\"string\"}]"
+                                                                }
+                                                            ]
+                                                        }
+                                                    ]
+                                                }
+                                            ]
+                                        }
+                                    ]
+                                },
                                 {
                                     "*prop": "colModel[]",
                                     "dataIndex": "dtstart",