From 8bd0524a3ab1c7c11d2a6374f0f1b32f89233843 Mon Sep 17 00:00:00 2001 From: edward Date: Mon, 18 Jul 2016 14:58:31 +0800 Subject: [PATCH] Pman.Dialog.CoreEmail.bjs Pman.Dialog.CoreEmail.js --- Pman.Dialog.CoreEmail.bjs | 57 +++++++++++++++++++++++++++++++ Pman.Dialog.CoreEmail.js | 71 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) diff --git a/Pman.Dialog.CoreEmail.bjs b/Pman.Dialog.CoreEmail.bjs index f49796a9..ee647eed 100644 --- a/Pman.Dialog.CoreEmail.bjs +++ b/Pman.Dialog.CoreEmail.bjs @@ -300,6 +300,63 @@ "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" : "
{file}
", + "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" + } + ] + } + ] } ] }, diff --git a/Pman.Dialog.CoreEmail.js b/Pman.Dialog.CoreEmail.js index b2ca0114..edd5296f 100644 --- a/Pman.Dialog.CoreEmail.js +++ b/Pman.Dialog.CoreEmail.js @@ -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 : '
{file}
', + 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' + } + } } ] }, -- 2.39.2