From 65c665213832d20037bb421b5ab0530d366da49d Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 11 Feb 2015 14:34:31 +0800 Subject: [PATCH] Pman.Tab.AdminNotify.bjs Pman.Tab.AdminNotify.js --- Pman.Tab.AdminNotify.bjs | 64 ++++++++++++++++++++++++++++-- Pman.Tab.AdminNotify.js | 84 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 139 insertions(+), 9 deletions(-) diff --git a/Pman.Tab.AdminNotify.bjs b/Pman.Tab.AdminNotify.bjs index 12d24ca..0d5853c 100644 --- a/Pman.Tab.AdminNotify.bjs +++ b/Pman.Tab.AdminNotify.bjs @@ -131,6 +131,66 @@ "xtype" : "Separator", "$ xns" : "Roo.Toolbar" }, + { + "listeners" : { + "render" : "function (_self)\n{\n _this.personCombo = _self;\n}", + "select" : "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}" + }, + "listWidth" : 400, + "triggerAction" : "all", + "forceSelection" : true, + "selectOnFocus" : true, + "pageSize" : 20, + "displayField" : "person_id_name", + "emptyText" : "Select person", + "hiddenName" : "id", + "minChars" : 2, + "valueField" : "person_id", + "xtype" : "ComboBox", + "allowBlank" : true, + "editable" : true, + "width" : 200, + "$ xns" : "Roo.form", + "name" : "name", + "qtip" : "Select core_notify", + "queryParam" : "query[person_id_name]", + "tpl" : "
{person_id_name} {person_id_email}
", + "loadingText" : "Searching...", + "items" : [ + { + "listeners" : { + "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n o.params._distinct='person_id';\n o.params._columns='person_id,person_id_name,person_id_email';\n o.params['!person_id_name'] = '';\n \n // set more here\n}\n" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ direction : 'ASC', field: 'person_id_name' }", + "$ xns" : "Roo.data", + "* prop" : "store", + "items" : [ + { + "$ url" : "baseURL + '/Roo/core_notify.php'", + "xtype" : "HttpProxy", + "method" : "GET", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"ontable\",\"type\":\"string\"}]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + } + ] + }, + { + "xtype" : "Separator", + "$ xns" : "Roo.Toolbar" + }, { "text" : "From", "xtype" : "TextItem", @@ -165,10 +225,6 @@ "width" : 100, "$ xns" : "Roo.form" }, - { - "xtype" : "Separator", - "$ xns" : "Roo.Toolbar" - }, { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" diff --git a/Pman.Tab.AdminNotify.js b/Pman.Tab.AdminNotify.js index 40ffadf..1b3668d 100644 --- a/Pman.Tab.AdminNotify.js +++ b/Pman.Tab.AdminNotify.js @@ -306,6 +306,85 @@ Pman.Tab.AdminNotify = new Roo.XComponent({ ] + }, + { + '|xns' : 'Roo.Toolbar', + xtype : 'Separator', + xns : Roo.Toolbar + }, + { + store : { + proxy : { + '|xns' : 'Roo.data', + url : baseURL + '/Roo/core_notify.php', + xtype : 'HttpProxy', + method : 'GET', + xns : Roo.data + }, + reader : { + '|xns' : 'Roo.data', + id : 'id', + root : 'data', + xtype : 'JsonReader', + xns : Roo.data, + fields : [{"name":"id","type":"int"},{"name":"ontable","type":"string"}], + totalProperty : 'total' + }, + '|xns' : 'Roo.data', + xtype : 'Store', + remoteSort : true, + sortInfo : { direction : 'ASC', field: 'person_id_name' }, + xns : Roo.data, + 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 + } + }, + items : [ + + ] + + }, + '|xns' : 'Roo.form', + listWidth : 400, + triggerAction : 'all', + forceSelection : true, + selectOnFocus : true, + pageSize : 20, + displayField : 'person_id_name', + emptyText : "Select person", + hiddenName : 'id', + minChars : 2, + valueField : 'person_id', + xtype : 'ComboBox', + allowBlank : true, + editable : true, + width : 200, + xns : Roo.form, + name : 'name', + qtip : "Select core_notify", + queryParam : 'query[person_id_name]', + tpl : '
{person_id_name} {person_id_email}
', + loadingText : "Searching...", + listeners : { + render : function (_self) + { + _this.personCombo = _self; + }, + select : function (combo, record, index) + { + _this.grid.footer.onClick('first'); + } + }, + items : [ + + ] + }, { '|xns' : 'Roo.Toolbar', @@ -365,11 +444,6 @@ Pman.Tab.AdminNotify = new Roo.XComponent({ } } }, - { - '|xns' : 'Roo.Toolbar', - xtype : 'Separator', - xns : Roo.Toolbar - }, { '|xns' : 'Roo.Toolbar', xtype : 'Fill', -- 2.39.2