From 139a3a5aa9e7b3ca26c9adc7e1c5c683a4596bd6 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 18 Mar 2014 15:55:53 +0800 Subject: [PATCH] Pman.Dialog.PersonEditor.js --- Pman.Dialog.PersonEditor.js | 118 +++++++++++++++++++----------------- 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/Pman.Dialog.PersonEditor.js b/Pman.Dialog.PersonEditor.js index d72e0b9d..f5742835 100644 --- a/Pman.Dialog.PersonEditor.js +++ b/Pman.Dialog.PersonEditor.js @@ -456,68 +456,74 @@ Pman.Dialog.PersonEditor.prototype = { width : 300 }, country : { - - xtype: 'ComboBoxAdder', - fieldLabel: "Country", + xtype: 'ComboBoxArray', + xns: Roo.form, + fieldLabel : 'Journalist', + hiddenName : 'country_id', name : 'country', - selectOnFocus:true, - qtip : "Select Country", - allowBlank : false, - width: 300, - - store: { - xtype : 'Store', - // load using HTTP - proxy:{ - xtype: 'HttpProxy', - url: baseURL + '/Roo/Companies.html', - method: 'GET' - }, - reader: Pman.Readers.Companies, + width : 520, + combo : { + xtype: 'ComboBox', + xns: Roo.form, listeners : { - beforeload : function(st,o) + add : function (combo) { - - o.params['!comptype'] = 'OWNER'; - }, - loadexception : Pman.loadException - + Pman.Dialog.ClippingJournalist.show({ + id:0, + _clipping_id : _this.form.findField('id').getValue(), + publication : _this.data.media_name, + country : _this.data.country, + campaign_id : _this.data.project_id, + campaign_name : _this.data.project_id_name + + }); + } }, - sortInfo: { - field: 'name', direction: 'ASC' - } - }, - displayField:'name', - valueField : 'id', - hiddenName: 'country_id', - typeAhead: true, - forceSelection: true, - //mode: 'local', - triggerAction: 'all', - tpl: new Ext.Template( - '
', - '{name} {address}', - '
' - ), - queryParam: 'query[name]', - loadingText: "Searching...", - listWidth: 400, - - minChars: 2, - pageSize:20, - listeners : { - adderclick : function() - { - var cb = this; - Pman.Dialog.CoreCompanies.show( { id: 0 }, function(data) { - cb.setFromData(data); - }); + allowBlank : true, + alwaysQuery : true, + displayField : 'name', + editable : false, + emptyText : "Select News", + fieldLabel : 'Journalist', + forceSelection : true, + idField : 'id', + loadingText : "Searching...", + minChars : 2, + pageSize : 20, + tpl : '
{name}, {publication}, {country_tr}
', + triggerAction : 'all', + typeAhead : true, + valueField : 'id', + width : 480, + store : { + xtype: 'Store', + xns: Roo.data, + listeners : { + beforeload : function (_self, o){ + o.params = o.params || {}; + o.params.campaign_id = _this.data.project_id; + } + }, + isLocal : false, + proxy : { + xtype: 'HttpProxy', + xns: Roo.data, + method : 'GET', + url : baseURL + '/Roo/Clipping_journalist.php' + }, + reader : { + xtype: 'JsonReader', + xns: Roo.data, + id : 'id', + root : 'data', + totalProperty : 'total', + fields : [ + {"name":"id","type":"int"}, + {"name":"name","type":"string"} + ] + } } } - - - - }, passwd1 : { name : 'passwd1', -- 2.39.2