xns: Roo,
closable : false,
collapsible : false,
- height : 350,
+ height : 290,
resizable : false,
title : "Edit / Create Contact Details",
- width : 500,
+ width : 450,
items : [
{
xtype: 'ContentPanel',
{
Pman.Dialog.Companies.show( { id: 0 }, function(data) {
- _this
+ _this.form.setValues({
+ company_id_name : data.name,
+ company_id : data.id
+ });
});
}
},
{
xtype: 'ComboBox',
xns: Roo.form,
+ listeners : {
+ add : function (combo)
+ {
+ var coid = _this.form.findField('company_id').getValue();
+ if (!coid ) {
+
+ Ext.MessageBox.alert("Error", "Select An Company First");
+ return false;
+
+ }
+ Pman.Dialog.Office.show(cfg, function(data) {
+ _this.form.setValues({
+ office_id_name : data.name,
+ office_id : data.id
+ });
+ });
+
+
+ },
+ beforequery : function (combo, query, forceAll, cancel, e)
+ {
+ var coid = _this.form.findField('company_id').getValue();
+ if (coid < 1 ) {
+ Ext.MessageBox.alert("Error", "Select An Company First");
+ return false;
+ }
+ }
+ },
allowBlank : 'false',
+ displayField : 'name',
editable : 'false',
emptyText : "Select Office",
+ fieldLabel : 'Office',
forceSelection : true,
+ hiddenName : 'office_id',
listWidth : 400,
loadingText : "Searching...",
minChars : 2,
+ name : 'office_id_name',
pageSize : 20,
qtip : "Select Office",
+ queryParam : 'query[name]',
selectOnFocus : true,
+ tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
triggerAction : 'all',
typeAhead : true,
- width : 300,
- tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
- queryParam : 'query[name]',
- fieldLabel : 'Office',
valueField : 'id',
- displayField : 'name',
- hiddenName : 'office_id',
- name : 'office_id_name',
+ width : 300,
store : {
xtype: 'Store',
xns: Roo.data,
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'id' },
listeners : {
beforeload : function (_self, o){
o.params = o.params || {};
- // set more here
+ var coid = _this.form.findField('company_id').getValue();
+ o.params.company_id = coid;
}
},
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'id' },
proxy : {
xtype: 'HttpProxy',
xns: Roo.data,
xns: Roo.form,
fieldLabel : 'Name',
name : 'name',
- width : 300
+ width : 300,
+ allowBlank : true
},
{
xtype: 'TextField',
{
xtype: 'TextField',
xns: Roo.form,
+ allowBlank : false,
fieldLabel : 'Email',
name : 'email',
width : 200