Pman.Tab.AdminNotify.bjs
[Pman.Admin] / Pman.Tab.AdminNotify.js
index cee6beb..4eb2e5b 100644 (file)
@@ -240,9 +240,19 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
                         {
                             xtype: 'ComboBox',
                             xns: Roo.form,
-                            allowBlank : false,
+                            listeners : {
+                                select : function (combo, record, index)
+                                {
+                                   (function() { _this.grid.footer.onClick('first'); }).defer(100);
+                                },
+                                render : function (_self)
+                                {
+                                
+                                }
+                            },
+                            allowBlank : true,
                             displayField : 'person_id_name',
-                            editable : false,
+                            editable : true,
                             emptyText : "Select person",
                             forceSelection : true,
                             hiddenName : 'id',
@@ -256,7 +266,6 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
                             selectOnFocus : true,
                             tpl : '<div class="x-grid-cell-text x-btn button"><b>{person_id_name}</b> {person_id_email}</div>',
                             triggerAction : 'all',
-                            typeAhead : true,
                             valueField : 'person_id',
                             width : 300,
                             store : {
@@ -265,11 +274,15 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
                                 listeners : {
                                     beforeload : function (_self, o){
                                         o.params = o.params || {};
+                                        o.params._distinct='person_id';
+                                        o.params._columns='person_id,person_id_name,person_id_email';
+                                        o.params['!person_id_name'] = '';
+                                        
                                         // set more here
                                     }
                                 },
                                 remoteSort : true,
-                                sortInfo : { direction : 'ASC', field: 'id' },
+                                sortInfo : { direction : 'ASC', field: 'person_id_name' },
                                 proxy : {
                                     xtype: 'HttpProxy',
                                     xns: Roo.data,
@@ -290,6 +303,19 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
                             xtype: 'Fill',
                             xns: Roo.Toolbar
                         },
+                        {
+                            xtype: 'Button',
+                            xns: Roo.Toolbar,
+                            listeners : {
+                                click : function()
+                                        {
+                                        Pman.genericDelete(_this, 'core_notify'); 
+                                        }
+                            },
+                            cls : 'x-btn-text-icon',
+                            text : "Delete",
+                            icon : rootURL + '/Pman/templates/images/trash.gif'
+                        },
                         {
                             xtype: 'Button',
                             xns: Roo.Toolbar,
@@ -364,11 +390,26 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
                         xns: Roo.grid,
                         dataIndex : 'person_id_name',
                         header : 'Who to notify',
-                        width : 200,
+                        width : 100,
                         renderer : function(v,x,r) {
                              return String.format('{0} <u>&lt;{1}&gt;</u>', v, r.data.person_id_email); 
                          }
                     },
+                    {
+                        xtype: 'ColumnModel',
+                        xns: Roo.grid,
+                        dataIndex : 'trigger_event_id',
+                        header : 'Triggered by',
+                        width : 100,
+                        renderer : function(v,x,r) {
+                             return String.format(
+                                    '{0} : {1} {2}', 
+                                    r.data.trigger_event_id_on_table, 
+                                    r.data.trigger_event_id_on_id, 
+                                    r.data.trigger_event_id_remarks
+                                ); 
+                         }
+                    },
                     {
                         xtype: 'ColumnModel',
                         xns: Roo.grid,
@@ -383,7 +424,7 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
                         dataIndex : 'event_id_remarks',
                         header : 'Event',
                         width : 300,
-                        renderer : function(v) { return String.format('{0}', v); }
+                        renderer : function(v) { return String.format('<span qtip="{0}">{0}</span>', v); }
                     }
                 ]
             }