PDA

View Full Version : mask a form_panel on submit



nadeemshafi9
29 Apr 2009, 7:49 AM
mask a form_panel on submit ?

can this be done throgh config options or does it require listeners etc ?

thanks

Condor
29 Apr 2009, 8:56 AM
Include a waitMsg in the load/submit options.

The BasicForm waitMsgTarget config option determines how the waitMsg is displayed (you'll probably want to set it to true).

nadeemshafi9
29 Apr 2009, 8:58 AM
yes i saw it and i couldent figure out what it took in

Condor
29 Apr 2009, 9:00 AM
waitMsg is simply a text.

waitMsgTarget can be:
true - show a standard mask with a loading message.
Element/DOM/element id - The target element for the mask (in case you want to mask more than the panel itself).
false/0/null/undefined - show a wait MessageBox.

nadeemshafi9
29 Apr 2009, 3:08 PM
thanks

nadeemshafi9
30 Apr 2009, 12:45 AM
waitMsg is simply a text.

waitMsgTarget can be:
true - show a standard mask with a loading message.
Element/DOM/element id - The target element for the mask (in case you want to mask more than the panel itself).
false/0/null/undefined - show a wait MessageBox.

thsi dosent seem to work



Ext.getCmp('purchaseFieldSet').addButton(
new Ext.Button({
text: 'ok',
minWidth: 100,
listeners: {
click: function() {
HERE!!!! Ext.getCmp('purchaseForm').getForm().waitMsgTarget = true;
Ext.getCmp('purchaseForm').getForm().submit({
clientValidation: true,
timeout: 10000,
url: '/api/purchase/submitdetails',
params: {
x: 'x'
},
success: function(form, action) {
if(action.result.success == 'true'){
}
Ext.Msg.alert('Success', action.result.msg);
},
failure: function(form, action) {
switch (action.failureType) {
case Ext.form.Action.CLIENT_INVALID:
Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
break;
case Ext.form.Action.CONNECT_FAILURE:
Ext.Msg.alert('Failure', 'Ajax communication failed');
break;
case Ext.form.Action.SERVER_INVALID:
Ext.Msg.alert('Failure', action.result.msg);
}
}
});
}
}
})
);
Ext.getCmp('purchaseForm').add(Ext.getCmp('purchaseFieldSet'));
Ext.getCmp('purchaseForm').doLayout();




do you recon it could be because its nto a standard submit ? but a button that does an ajax call submit

Condor
30 Apr 2009, 1:21 AM
I don't see a waitMsg in your submit() parameters.