Pman.Dialog.CoreEmail.bjs
authoredward <edward@roojs.com>
Mon, 18 Jul 2016 06:58:31 +0000 (14:58 +0800)
committeredward <edward@roojs.com>
Mon, 18 Jul 2016 06:58:31 +0000 (14:58 +0800)
Pman.Dialog.CoreEmail.js

Pman.Dialog.CoreEmail.bjs
Pman.Dialog.CoreEmail.js

index f49796a..ee647ee 100644 (file)
                "width" : 300,
                "$ xns" : "Roo.form",
                "name" : "from_email"
+              },
+              {
+               "listeners" : {
+                "select" : "function (combo, record, index)\n{\n   \n/*\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n*/    \n    if(!record){\n        return;\n    }\n    _this.form.findField('bodytext').setValue(record.data.content);\n\n}"
+               },
+               "alwaysQuery" : true,
+               "listWidth" : 400,
+               "triggerAction" : "all",
+               "fieldLabel" : "Template",
+               "forceSelection" : true,
+               "selectOnFocus" : true,
+               "pageSize" : 20,
+               "displayField" : "file",
+               "emptyText" : "Select Template",
+               "hiddenName" : "template",
+               "minChars" : 2,
+               "valueField" : "file",
+               "xtype" : "ComboBox",
+               "allowBlank" : true,
+               "typeAhead" : true,
+               "editable" : false,
+               "width" : 200,
+               "$ xns" : "Roo.form",
+               "name" : "template",
+               "qtip" : "Select Template",
+               "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{file}</b> </div>",
+               "loadingText" : "Searching...",
+               "items" : [
+                {
+                 "listeners" : {
+                  "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n   \n}\n"
+                 },
+                 "xtype" : "Store",
+                 "remoteSort" : true,
+                 "$ sortInfo" : "{ direction : 'DESC', field: 'file' }",
+                 "$ xns" : "Roo.data",
+                 "* prop" : "store",
+                 "items" : [
+                  {
+                   "$ url" : "baseURL + '/Core/MailTemplateList.php'",
+                   "xtype" : "HttpProxy",
+                   "method" : "GET",
+                   "$ xns" : "Roo.data",
+                   "* prop" : "proxy"
+                  },
+                  {
+                   "id" : "name",
+                   "root" : "data",
+                   "xtype" : "JsonReader",
+                   "$ fields" : "[{\"name\":\"file\",\"type\":\"string\"},{\"name\":\"content\",\"type\":\"string\"}]",
+                   "$ xns" : "Roo.data",
+                   "* prop" : "reader",
+                   "totalProperty" : "total"
+                  }
+                 ]
+                }
+               ]
               }
              ]
             },
index b2ca011..edd5296 100644 (file)
@@ -663,6 +663,77 @@ Pman.Dialog.CoreEmail = {
                xns : Roo.form,
                '|xns' : 'Roo.form',
                xtype : 'TextField'
+              },
+              {
+               allowBlank : true,
+               alwaysQuery : true,
+               displayField : 'file',
+               editable : false,
+               emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
+               fieldLabel : _this._strings['278c491bdd8a53618c149c4ac790da34'] /* Template */,
+               forceSelection : true,
+               hiddenName : 'template',
+               listWidth : 400,
+               loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+               minChars : 2,
+               name : 'template',
+               pageSize : 20,
+               qtip : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
+               selectOnFocus : true,
+               tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{file}</b> </div>',
+               triggerAction : 'all',
+               typeAhead : true,
+               valueField : 'file',
+               width : 200,
+               xns : Roo.form,
+               '|xns' : 'Roo.form',
+               xtype : 'ComboBox',
+               listeners : {
+                select : function (combo, record, index)
+                 {
+                    
+                 /*
+                     (function() { 
+                         combo.setValue('');
+                     }).defer(100);
+                 */    
+                     if(!record){
+                         return;
+                     }
+                     _this.form.findField('bodytext').setValue(record.data.content);
+                 
+                 }
+               },
+               store : {
+                remoteSort : true,
+                sortInfo : { direction : 'DESC', field: 'file' },
+                xns : Roo.data,
+                '|xns' : 'Roo.data',
+                xtype : 'Store',
+                listeners : {
+                 beforeload : function (_self, o){
+                      o.params = o.params || {};
+                      // set more here
+                     
+                  }
+                },
+                proxy : {
+                 method : 'GET',
+                 url : baseURL + '/Core/MailTemplateList.php',
+                 xns : Roo.data,
+                 '|xns' : 'Roo.data',
+                 xtype : 'HttpProxy'
+                },
+                reader : {
+                 fields : [{"name":"file","type":"string"},{"name":"content","type":"string"}],
+                 id : 'name',
+                 root : 'data',
+                 totalProperty : 'total',
+                 xns : Roo.data,
+                 '|xns' : 'Roo.data',
+                 xtype : 'JsonReader'
+                }
+               }
               }
              ]
             },