actioncomplete: function(f, act) {
_this.dialog.el.unmask();
if (act.type == 'load') {
+
_this.data = act.result.data;
-
}
var data = _this.data;
// we dont have a form where company name is sent in - and is editable..
//this.form.findField('office_id')
+ if(!data.countries && _this.form.findField('countries')){
+ _this.form.findField('countries').setValue();// set empty array by default...
+ }
if (_this.form.findField('company_id') && _this.form.findField('company_id').setFromData) {
_this.form.findField('company_id').setFromData( data.company_id ? {
}
}
+
+
return;
}
xtype : 'TextField',
width : 300
},
- country : {
-
- xtype: 'ComboBoxAdder',
- fieldLabel: "Company",
- name : 'country',
- selectOnFocus:true,
- qtip : "Select Company",
- allowBlank : false,
- width: 300,
-
- store: {
- xtype : 'Store',
- // load using HTTP
- proxy:{
- xtype: 'HttpProxy',
- url: baseURL + '/Roo/Companies.html',
- method: 'GET'
- },
- reader: Pman.Readers.Companies,
- listeners : {
- beforeload : function(st,o)
- {
-
- o.params['!comptype'] = 'OWNER';
- },
- loadexception : Pman.loadException
-
- },
- sortInfo: {
- field: 'name', direction: 'ASC'
- }
- },
- displayField:'name',
- valueField : 'id',
- hiddenName: 'country_id',
- typeAhead: true,
- forceSelection: true,
- //mode: 'local',
- triggerAction: 'all',
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '<b>{name}</b> {address}',
- '</div>'
- ),
- 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);
- });
+ countries : {
+ xtype: 'ComboBoxArray',
+ xns: Roo.form,
+ fieldLabel : 'Country',
+ hiddenName : 'countries',
+ name : 'countries_name',
+ width : 300,
+ combo : {
+ xtype: 'ComboBox',
+ xns: Roo.form,
+ allowBlank : true,
+ alwaysQuery : true,
+ displayField : 'title',
+ editable : false,
+ emptyText : "Select Country",
+ forceSelection : true,
+ idField : 'id',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'code',
+ width : 280,
+ store : {
+ xtype: 'SimpleStore',
+ xns: Roo.data,
+ data : (function() {
+ return Pman.I18n.simpleStoreData('c');
+ })(),
+ fields : [ 'code', 'title' ]
}
}
-
-
-
-
},
passwd1 : {
name : 'passwd1',