Pman.Tab.AdminNotify.bjs
[Pman.Admin] / Pman.Tab.AdminNotify.bjs
index 876a644..0d5853c 100644 (file)
@@ -31,7 +31,7 @@
                     "items" : [
                         {
                             "listeners" : {
-                                "beforeload" : "function (_self, options)\n{\n    options.params = options.params || {};\n    \n    options.params._evtype_align = 1;\n    \n    if (!_this.toggleBtn.pressed) {\n        options.params['event_id'] = 0;\n    }\n    if (!_this.personCombo) {\n        return false;\n    }\n    var p = _this.personCombo.getValue();\n    if (p*1) { \n        options.params.person_id = p;\n    }\n    \n}"
+                                "beforeload" : "function (_self, options)\n{\n    options.params = options.params || {};\n    \n    options.params._evtype_align = 1;\n    \n    if (!_this.toggleBtn.pressed) {\n        options.params['event_id'] = 0;\n    }\n    if (!_this.personCombo) {\n        return false;\n    }\n    var p = _this.personCombo.getValue();\n    if (p*1) { \n        options.params.person_id = p;\n    }\n    \n    var from = _this.fromDateSel.getValue();\n    \n    if(from){\n        options.params.from = from.format('Y-m-d');\n    }\n    \n    var to = _this.toDateSel.getValue();\n    \n    if(to){\n        options.params.to = to.format('Y-m-d');\n    }\n}"
                             },
                             "xtype" : "Store",
                             "remoteSort" : true,
@@ -89,7 +89,7 @@
                                     "xtype" : "ComboBox",
                                     "allowBlank" : true,
                                     "editable" : true,
-                                    "width" : 300,
+                                    "width" : 200,
                                     "$ xns" : "Roo.form",
                                     "name" : "name",
                                     "qtip" : "Select core_notify",
                                     "xtype" : "Separator",
                                     "$ xns" : "Roo.Toolbar"
                                 },
+                                {
+                                    "listeners" : {
+                                        "render" : "function (_self)\n{\n   _this.personCombo = _self;\n}",
+                                        "select" : "function (combo, record, index)\n{\n   _this.grid.footer.onClick('first');\n}"
+                                    },
+                                    "listWidth" : 400,
+                                    "triggerAction" : "all",
+                                    "forceSelection" : true,
+                                    "selectOnFocus" : true,
+                                    "pageSize" : 20,
+                                    "displayField" : "person_id_name",
+                                    "emptyText" : "Select person",
+                                    "hiddenName" : "id",
+                                    "minChars" : 2,
+                                    "valueField" : "person_id",
+                                    "xtype" : "ComboBox",
+                                    "allowBlank" : true,
+                                    "editable" : true,
+                                    "width" : 200,
+                                    "$ xns" : "Roo.form",
+                                    "name" : "name",
+                                    "qtip" : "Select core_notify",
+                                    "queryParam" : "query[person_id_name]",
+                                    "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{person_id_name}</b> {person_id_email}</div>",
+                                    "loadingText" : "Searching...",
+                                    "items" : [
+                                        {
+                                            "listeners" : {
+                                                "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    o.params._distinct='person_id';\n    o.params._columns='person_id,person_id_name,person_id_email';\n    o.params['!person_id_name'] = '';\n    \n    // set more here\n}\n"
+                                            },
+                                            "xtype" : "Store",
+                                            "remoteSort" : true,
+                                            "$ sortInfo" : "{ direction : 'ASC', field: 'person_id_name' }",
+                                            "$ xns" : "Roo.data",
+                                            "* prop" : "store",
+                                            "items" : [
+                                                {
+                                                    "$ url" : "baseURL + '/Roo/core_notify.php'",
+                                                    "xtype" : "HttpProxy",
+                                                    "method" : "GET",
+                                                    "$ xns" : "Roo.data",
+                                                    "* prop" : "proxy"
+                                                },
+                                                {
+                                                    "id" : "id",
+                                                    "root" : "data",
+                                                    "xtype" : "JsonReader",
+                                                    "$ xns" : "Roo.data",
+                                                    "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"ontable\",\"type\":\"string\"}]",
+                                                    "* prop" : "reader",
+                                                    "totalProperty" : "total"
+                                                }
+                                            ]
+                                        }
+                                    ]
+                                },
+                                {
+                                    "xtype" : "Separator",
+                                    "$ xns" : "Roo.Toolbar"
+                                },
                                 {
                                     "text" : "From",
                                     "xtype" : "TextItem",