PHP Code:
...
showDialog : function(data){
if(!dialog){
dialog = new Ext.Window({
el: 'dlg_dnsInsertUpdate',
animateTarget: 'north',
layout: 'fit',
width: 390,
height: 420,
shadow: true,
modal: false,
resizable: false,
fixedcenter: true,
constraintoviewport: true,
proxyDrag: true,
collapsible: true,
animCollapse: true,
closeAction: 'hide',
plain: true,
animCollapse : true,
constrain: true,
resizable: false,
buttons: [{
icon: 'img/toolbar/silk_icons/icons/stop.png',
cls:"x-btn-text-icon",
text: 'Close',
handler: function(){
dialog.hide();
}
}]
});
DLG_insertUpdate_form.buildForm();
//this.buildButtons();
}
if (formAction == 'update') {
DLG_insertUpdate_form.setValues(data);
}
if (dialog) {
dialog.expand(true);
}
dialog.show();
//this.resetForm();
},
hideDialog : function () {
if (dialog) {
dialog.hide();
}
},
buildForm : function () {
if (! inputFormPanel) {
//Ext.example.msg('Insert/Update Record', '{0}', 'BuildForm');
/* HostName Query */
inputFormPanel = new Ext.form.FormPanel({
labelAlign: 'right',
method: 'GET',
url: 'dnsmanager.php',
labelWidth: 80,
frame: true
});
inputFormPanel.add(
new Ext.form.TextField({
fieldLabel: 'Host ID',
id: 'hostid',
name: 'hostid',
width: 240,
readOnly: true
}),
new Ext.form.TextField({
fieldLabel: 'Host Name',
id: 'hostname',
name: 'hostname',
vtype: 'hostname',
allowBlank: false,
width: 240,
readOnly: true
}),
new Ext.form.TextField({
fieldLabel: 'IP Address',
id: 'ipaddress',
name: 'ipaddress',
vtype: 'ip',
allowBlank: false,
width: 240,
readOnly: true
}),
new Ext.form.TextField({
fieldLabel: 'Alias 1',
id: 'alias_1',
name: 'alias_1',
width: 240,
readOnly: true
}),
new Ext.form.TextField({
fieldLabel: 'Alias 2',
id: 'alias_2',
name: 'alias_2',
width: 240,
readOnly: true
}),
new Ext.form.TextField({
fieldLabel: 'Alias 3',
id: 'alias_3',
name: 'alias_3',
width: 240,
readOnly: true
}),
new Ext.form.TextField({
fieldLabel: 'Alias 4',
id: 'alias_4',
name: 'alias_4',
width: 240,
readOnly: true
}),
new Ext.form.TextField({
fieldLabel: 'Class',
id: 'class_mar',
width: 240,
readOnly: true
}),
new Ext.form.TextField({
fieldLabel: 'Brand',
id: 'brand',
width: 240,
readOnly: true
}),
new Ext.form.TextField({
fieldLabel: 'Domain',
id: 'domain',
width: 240,
readOnly: true
}),
new Ext.form.TextArea({
fieldLabel: 'Comment',
id:'comment',
width:240,
grow: false,
allowBlank: false,
height:75,
readOnly: true
})
);
inputFormPanel.on('actioncomplete', this.formComplete, this);
inputFormPanel.render('frmDNSInsertUpdate');
}
},
...