Pman.Dialog.CoreNotifyRefer.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 16 May 2012 04:46:24 +0000 (12:46 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 16 May 2012 04:46:24 +0000 (12:46 +0800)
Pman.Dialog.CoreNotifyRefer.js

Pman.Dialog.CoreNotifyRefer.bjs
Pman.Dialog.CoreNotifyRefer.js

index 7e12913..4239c12 100644 (file)
                                     "header": "Frequency",
                                     "width": 100,
                                     "xtype": "ColumnModel",
-                                    "|renderer": "function(v) { \n\n    \n    grid.colModel.config[2].editor.field.store.query('code','WEEKLY').first().data.title\n    return String.format('{0}', v);\n }",
+                                    "|renderer": "function(v) { \n\n    \n    var matches = this.editor.field.store.query('code',v);\n    if (!matches.length) {\n        return '';\n    }\n    return String.format('{0}', matches.first().data.title);\n }",
                                     "|xns": "Roo.grid",
                                     "items": [
                                         {
index 9b5f733..8162cc6 100644 (file)
@@ -247,8 +247,11 @@ Pman.Dialog.CoreNotifyRefer = {
                                 renderer : function(v) { 
                                 
                                     
-                                    grid.colModel.config[2].editor.field.store.query('code','WEEKLY').first().data.title
-                                    return String.format('{0}', v);
+                                    var matches = this.editor.field.store.query('code',v);
+                                    if (!matches.length) {
+                                        return '';
+                                    }
+                                    return String.format('{0}', matches.first().data.title);
                                  },
                                 editor : {
                                     xtype: 'GridEditor',