sri_js
4 Aug 2009, 7:24 AM
Hi All,
I have code snipped like this:
in asp ------
JavaScriptSerializer serializer = newJavaScriptSerializer();
try
{
db.clients.InsertOnSubmit(newAccount);
db.SubmitChanges();
var x = new
{
success = true,
data = new { }
};Response.Write(serializer.Serialize(x));
Response.End();
}
catch (Exception ex)
{}
in js-------
buttons: [{
text: 'Save',
handler: function() {
if (tab2.form.isValid()) {
tab2.getForm().submit({
waitMsg: 'In processing',
scope: this,
failure: function(form, action) {
if (action.failureType == 'server') {
obj = Ext.util.JSON.decode(action.response.responseText);
Ext.Msg.alert('Warning!', obj.errors.reason);
} else {
Ext.Msg.alert('Warning!', 'Fail to save data. ' + action.response.responseText);
}
},
success: function(form, action) {
Ext.MessageBox.show({
title: 'Success:',
msg: action.response.responseText,
modal: true,
buttons: Ext.MessageBox.OK,
icon:Ext.Msg.ERROR
});
}
});
}
--------
it is ok except that....when i click save button.....waitMsg never stop. any suggestion to resolve it? thanks.
I have code snipped like this:
in asp ------
JavaScriptSerializer serializer = newJavaScriptSerializer();
try
{
db.clients.InsertOnSubmit(newAccount);
db.SubmitChanges();
var x = new
{
success = true,
data = new { }
};Response.Write(serializer.Serialize(x));
Response.End();
}
catch (Exception ex)
{}
in js-------
buttons: [{
text: 'Save',
handler: function() {
if (tab2.form.isValid()) {
tab2.getForm().submit({
waitMsg: 'In processing',
scope: this,
failure: function(form, action) {
if (action.failureType == 'server') {
obj = Ext.util.JSON.decode(action.response.responseText);
Ext.Msg.alert('Warning!', obj.errors.reason);
} else {
Ext.Msg.alert('Warning!', 'Fail to save data. ' + action.response.responseText);
}
},
success: function(form, action) {
Ext.MessageBox.show({
title: 'Success:',
msg: action.response.responseText,
modal: true,
buttons: Ext.MessageBox.OK,
icon:Ext.Msg.ERROR
});
}
});
}
--------
it is ok except that....when i click save button.....waitMsg never stop. any suggestion to resolve it? thanks.