1 //<script type="text/javascript">
13 this.dialog = new Ext.LayoutDialog(Ext.get(document.body).createChild({tag:'div'}), {
15 title: "Edit Office / Department / Sub Company",
28 // tabPosition: 'top',
34 this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
35 this.dialog.addButton("Cancel", this.dialog.hide, this.dialog);
37 this.dialog.addButton("Save", this.save, this);
38 this.layout = this.dialog.getLayout();
39 this.layout.beginUpdate();
41 var dg = Pman.Dialog.Office;
43 this.form = new Ext.form.Form({
46 actionfailed : function(f, act) {
47 dg.dialog.el.unmask();
50 Pman.standardActionFailed(f,act);
53 actioncomplete: function(f, act) {
54 dg.dialog.el.unmask();
55 //console.log('load completed');
56 // error messages?????
59 if (act.type == 'load') {
61 dg.data = act.result.data;
67 if (act.type == 'submit') { // only submitted here if we are
70 dg.callback.call(this, act.result.data);
82 //?? will this work...
83 this.form.addxtype.apply(this.form,[{
89 'name' : 'company_id',
94 'name' : 'company_id_name',
95 'fieldLabel' : "Company",
97 'xtype' : 'TextField',
104 'fieldLabel' : "Office / Department / Sub Comp. Name",
106 'allowBlank' : false,
107 'qtip' : "Enter name",
108 'xtype' : 'TextField',
112 'fieldLabel' : "Address",
115 'qtip' : "Enter address",
116 'xtype' : 'TextArea',
121 'fieldLabel' : "Phone",
124 'qtip' : "Enter phone",
125 'xtype' : 'TextField',
129 'fieldLabel' : "fax",
132 'qtip' : "Enter fax",
133 'xtype' : 'TextField',
137 'fieldLabel' : "Email",
140 'qtip' : "Enter email",
141 'xtype' : 'TextField',
145 var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
146 ef.dom.style.margin = 10;
148 this.form.render(ef.dom);
150 var vp = this.dialog.getLayout().add('center', new Ext.ContentPanel(ef, {
152 //title: 'Org Details',
162 this.layout.endUpdate();
165 show : function(data, callback)
167 this.callback= callback;
173 this.form.setValues(data);
175 this.form.findField('name').focus();
181 this.form.doAction('submit', {
182 url: baseURL + '/Roo/Office.html',