Pman.Dialog.CoreNotifyRecur.bjs
[Pman.Core] / Pman.Dialog.CoreNotifyRecur.js
index 25a955b..22034fa 100644 (file)
@@ -236,15 +236,16 @@ Pman.Dialog.CoreNotifyRecur = {
                                 {
                                     xtype: 'Button',
                                     xns: Roo.Toolbar,
-                                    text : "Delete",
-                                    cls : 'x-btn-text-icon',
-                                    icon : rootURL + '/Pman/templates/images/trash.gif',
                                     listeners : {
                                         click : function()
                                         {
-                                             Pman.genericDelete(_this, 'core_notify_recur'); 
+                                             var s = _this.grid.getSelectionModel().getSelected();
+                                             Roo.log(s);
                                         }
-                                    }
+                                    },
+                                    cls : 'x-btn-text-icon',
+                                    text : "Delete",
+                                    icon : rootURL + '/Pman/templates/images/trash.gif'
                                 }
                             ]
                         },
@@ -289,6 +290,30 @@ Pman.Dialog.CoreNotifyRecur = {
                                 width : 100,
                                 renderer : function(v,x,r) { 
                                     
+                                    if (v.length) {
+                                     
+                                        var cm = _this.grid.colModel;
+                                       
+                                        var ci = cm.getColumnByDataIndex(this.name);
+                                       
+                                         var tv = [];
+                                        var vals = Roo.decode(v);
+                                        Roo.each(vals, function(k) {
+                                            var r = this.findRecord(this.valueField, k);
+                                            if(r){
+                                                tv.push(r.data[this.displayField]);
+                                            }else if(this.valueNotFoundText !== undefined){
+                                                tv.push( this.valueNotFoundText );
+                                            }
+                                        },ci.editor.field);
+                                
+                                        r.data[this.name + '_name'] = tv.join(', ');
+                                        return String.format('{0}',tv.join(', '));
+                                
+                                        
+                                    
+                                    }
+                                    r.data[this.name + '_name'] = '';
                                     return String.format('{0}', r.data.freq_day_name || v); 
                                     
                                 },
@@ -333,22 +358,31 @@ Pman.Dialog.CoreNotifyRecur = {
                                 width : 250,
                                 renderer : function(v,x,r) { 
                                     
-                                    Roo.log(x);
+                                 
                                     if (v.length) {
+                                     
                                         var cm = _this.grid.colModel;
-                                        Roo.log(this);
-                                        var ci = cm.getColumnByDataIndex(this.dataIndex);
-                                        Roo.log(ci);
-                                        
-                                        var ce = cm.getCellEditor(ci);
-                                        Roo.log(ce);
-                                        ce.field.setValue(v);
-                                        return String.format('{0}',ce.field.el.value);
+                                       
+                                        var ci = cm.getColumnByDataIndex(this.name);
+                                       
+                                         var tv = [];
+                                        var vals = Roo.decode(v);
+                                        Roo.each(vals, function(k) {
+                                            var r = this.findRecord(this.valueField, k);
+                                            if(r){
+                                                tv.push(r.data[this.displayField]);
+                                            }else if(this.valueNotFoundText !== undefined){
+                                                tv.push( this.valueNotFoundText );
+                                            }
+                                        },ci.editor.field);
+                                
+                                         r.data[this.name + '_name'] = tv.join(', ');
+                                        return String.format('{0}',tv.join(', '));
                                 
                                         
                                     
                                     }
-                                    
+                                        r.data[this.name + '_name'] = '';
                                     return String.format('{0}', r.data.freq_hour_name || v); 
                                     
                                 },