PDA

View Full Version : FormPanel and load inside definition



lormitto
4 Mar 2010, 5:12 AM
Hi,

Lack of principles again i think.

I found following example:


var myFormPanel = new Ext.form.FormPanel({
title: 'Client and routing info',
items: [{
fieldLabel: 'Client',
name: 'clientName'
}, {
fieldLabel: 'Port of loading',
name: 'portOfLoading'
}, {
fieldLabel: 'Port of discharge',
name: 'portOfDischarge'
}]
});
myFormPanel.getForm (http://www.extjs.com/forum/../deploy/dev/docs/output/Ext.form.FormPanel.html#Ext.form.FormPanel-getForm)().load (http://www.extjs.com/forum/../deploy/dev/docs/output/Ext.form.BasicForm.html#Ext.form.BasicForm-load)({
url: '/getRoutingInfo.php',
params: {
consignmentRef: myConsignmentRef
},
failure: function(form, action) {
Ext.Msg.alert("Load failed", action.result.errorMessage);
}
});

Is there any way to place


(http://www.extjs.com/forum/../deploy/dev/docs/output/Ext.form.FormPanel.html#Ext.form.FormPanel-getForm)getForm (http://www.extjs.com/forum/../deploy/dev/docs/output/Ext.form.FormPanel.html#Ext.form.FormPanel-getForm)().load (http://www.extjs.com/forum/../deploy/dev/docs/output/Ext.form.BasicForm.html#Ext.form.BasicForm-load)({
url: '/getRoutingInfo.php',
params: {
consignmentRef: myConsignmentRef
},
failure: function(form, action) {
Ext.Msg.alert("Load failed", action.result.errorMessage);
}
});

inside:

var myFormPanel = new Ext.form.FormPanel({ place it here })


?