時成功是假的操作不會有響應特性。這個線程非常好地解釋它!
http://www.sencha.com/forum/showthread.php?196013-access-operation.response-when-success-false
例子:
Ext.define("SC.store.SegurosCancelacionStore", {
extend: "Ext.data.Store",
model: "SC.model.PersonaSeguro",
proxy: {
timeout: 90000,
actionMethods: {
read : 'POST'
},
type: "ajax",
url: "../SegurosFinsolCancelacionServlet",
reader: {
type: "json",
root: "seguros",
messageProperty : 'msjError' //without this, it doesn't work
}
},
autoLoad: false
});
實現:
storeSegurosCancelacion.load({
params: {
'sucursal':sucursal,
'persona': persona
},
callback:function(records, operation, success){
msg.hide();
if(success == true){
if(records.length == 0){
Ext.Msg.alert('Resultado', 'No se ha encontrado información');
}
}
if(success == false){
try{
Ext.Msg.alert('Error', operation.getError()); // way more elegant than ussing rawData etc ...
}catch(e){
Ext.Msg.alert('Error', 'Error inesperado en el servidor.');
}
}
}
});
問候 @ code4jhon
你可以以你的問題一點?例如,您在哪裏看到「請求」或「遠程」錯誤?如果它位於商店的'loadexception'偵聽器中,那麼它應該只有'response'和'remote'的異常類型。你在哪裏看到'請求'錯誤?如果您可以提供代碼示例,那將更好地幫助解答您的問題。 – 2011-03-11 16:30:21