Pman.Tab.AdminNotify.bjs
[Pman.Admin] / Pman.Tab.AdminNotify.bjs
index cca5c3b..2226bac 100644 (file)
@@ -21,7 +21,6 @@
             "items" : [
                 {
                     "listeners" : {
-                        "|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",
                         "|render" : "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}"
                     },
                     "autoExpandColumn" : "person_id_name",
@@ -32,7 +31,7 @@
                     "items" : [
                         {
                             "listeners" : {
-                                "beforeload" : "function (_self, options)\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}"
                             },
                             "xtype" : "Store",
                             "remoteSort" : true,
@@ -75,7 +74,7 @@
                                 {
                                     "listeners" : {
                                         "render" : "function (_self)\n{\n   _this.personCombo = _self;\n}",
-                                        "select" : "function (combo, record, index)\n{\n   (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}"
+                                        "select" : "function (combo, record, index)\n{\n   _this.grid.footer.onClick('first');\n}"
                                     },
                                     "listWidth" : 400,
                                     "triggerAction" : "all",
                                         }
                                     ]
                                 },
+                                {
+                                    "xtype" : "Separator",
+                                    "$ xns" : "Roo.Toolbar"
+                                },
+                                {
+                                    "text" : "From",
+                                    "xtype" : "TextItem",
+                                    "$ xns" : "Roo.Toolbar"
+                                },
+                                {
+                                    "listeners" : {
+                                        "render" : "function (_self)\r\n{\r\n    _this.fromDateSel = _self;\r\n   _self.setValue(  new Date() );\r\n}",
+                                        "select" : "function (combo, date)\n{\n    _this.grid.footer.onClick('first');\n}"
+                                    },
+                                    "format" : "d/M/Y",
+                                    "xtype" : "DateField",
+                                    "width" : 100,
+                                    "$ xns" : "Roo.form"
+                                },
+                                {
+                                    "xtype" : "Separator",
+                                    "$ xns" : "Roo.Toolbar"
+                                },
+                                {
+                                    "text" : "To",
+                                    "xtype" : "TextItem",
+                                    "$ xns" : "Roo.Toolbar"
+                                },
+                                {
+                                    "listeners" : {
+                                        "render" : "function (_self)\r\n{\r\n    _this.toDateSel = _self;\r\n   //_self.setValue(  new Date() );\r\n}",
+                                        "select" : "function (combo, date)\n{\n    _this.grid.footer.onClick('first');\n}"
+                                    },
+                                    "format" : "d/M/Y",
+                                    "xtype" : "DateField",
+                                    "width" : 100,
+                                    "$ xns" : "Roo.form"
+                                },
                                 {
                                     "xtype" : "Fill",
                                     "$ xns" : "Roo.Toolbar"
                                 },
                                 {
                                     "listeners" : {
-                                        "|click" : "function()\n        {\n        Pman.genericDelete(_this, 'core_notify'); \n        }\n        "
+                                        "|click" : "function()\n{\n    Pman.genericDelete(_this, 'core_notify'); \n}\n        "
                                     },
                                     "text" : "Delete",
                                     "xtype" : "Button",
                             "xtype" : "ColumnModel",
                             "sortable" : true,
                             "header" : "Method",
-                            "width" : 100,
-                            "$ renderer" : "function(v) { return String.format('{0}', v ); }",
+                            "width" : 200,
+                            "$ renderer" : "function(v,x,r) \n{ \n    var vv = (typeof(r.data.evtype_align) != 'undefined' && r.data.evtype_align) ? r.data.evtype_align : v;\n    return String.format('<span qtip=\"{0}\">{1}</span>', v, vv ); \n}",
                             "$ xns" : "Roo.grid",
                             "* prop" : "colModel[]",
                             "dataIndex" : "evtype"
                             "xtype" : "ColumnModel",
                             "sortable" : true,
                             "header" : "Act when",
-                            "width" : 100,
+                            "width" : 150,
                             "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
                             "$ xns" : "Roo.grid",
                             "* prop" : "colModel[]",
                             "xtype" : "ColumnModel",
                             "sortable" : true,
                             "header" : "Sent",
-                            "width" : 100,
+                            "width" : 150,
                             "$ renderer" : "function(v,x,r) {\n    if (r.data.event_id *1 == 0) {\n        return '';\n    }\n     return String.format('{0}', v ? v.format('d/M/Y H:i:s') : '');\n  }",
                             "$ xns" : "Roo.grid",
                             "* prop" : "colModel[]",
                         {
                             "xtype" : "ColumnModel",
                             "header" : "Ontable",
-                            "width" : 100,
+                            "width" : 150,
                             "$ renderer" : "function(v,x,r) { return String.format('{0}:{1}', v,r.data.onid); }",
                             "$ xns" : "Roo.grid",
                             "* prop" : "colModel[]",